Skip to content

Commit

Permalink
upgrade node test version
Browse files Browse the repository at this point in the history
  • Loading branch information
icambron committed Aug 26, 2023
1 parent 1a03b22 commit e3d8031
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 57 deletions.
31 changes: 15 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ name: Test

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
build-and-test:

runs-on: ubuntu-latest

env:
Expand All @@ -18,18 +17,18 @@ jobs:

strategy:
matrix:
node-version: [19.7.0]
node-version: [20.5.1]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm run format-check
- run: npm run test
- run: npm run site
- run: bash <(curl -s https://codecov.io/bash)
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: npm run build
- run: npm run format-check
- run: npm run test
- run: npm run site
- run: bash <(curl -s https://codecov.io/bash)
2 changes: 1 addition & 1 deletion scripts/test
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env bash
TZ="America/New_York" NODE_ICU_DATA="$(pwd)/node_modules/full-icu" LANG=en_US.utf8 npm run test
TZ="America/New_York" LANG=en_US.utf8 npm run test
8 changes: 4 additions & 4 deletions test/datetime/format.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,17 +426,17 @@ test("DateTime#toLocaleString() returns something different for invalid DateTime

test("DateTime#toLocaleString() shows things in the right IANA zone", () => {
expect(dt.setZone("America/New_York").toLocaleString(DateTime.DATETIME_SHORT)).toBe(
"5/25/1982, 5:23AM"
"5/25/1982, 5:23 AM"
);
});

test("DateTime#toLocaleString() shows things in the right fixed-offset zone", () => {
expect(dt.setZone("UTC-8").toLocaleString(DateTime.DATETIME_SHORT)).toBe("5/25/1982, 1:23AM");
expect(dt.setZone("UTC-8").toLocaleString(DateTime.DATETIME_SHORT)).toBe("5/25/1982, 1:23 AM");
});

test("DateTime#toLocaleString() shows things in the right fixed-offset zone when showing the zone", () => {
expect(dt.setZone("UTC-8").toLocaleString(DateTime.DATETIME_FULL)).toBe(
"May 25, 1982 at 1:23AM GMT-8"
"May 25, 1982 at 1:23 AM GMT-8"
);
});

Expand Down Expand Up @@ -503,7 +503,7 @@ test("DateTime#toLocaleString() accepts a zone even when the zone is set", () =>
timeZoneName: "short",
timeZone: "America/Los_Angeles",
})
).toBe("2:23AM PDT");
).toBe("2:23 AM PDT");
});

//------
Expand Down
72 changes: 36 additions & 36 deletions test/datetime/toFormat.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
import { DateTime } from "../../src/luxon";

const dt = DateTime.fromObject(
{
year: 1982,
month: 5,
day: 25,
hour: 9,
minute: 23,
second: 54,
millisecond: 123,
},
{
zone: "utc",
}
),
ny = dt.setZone("America/New_York", { keepLocalTime: true });
{
year: 1982,
month: 5,
day: 25,
hour: 9,
minute: 23,
second: 54,
millisecond: 123,
},
{
zone: "utc",
}
);
const ny = dt.setZone("America/New_York", { keepLocalTime: true });

//------
// #toFormat()
Expand Down Expand Up @@ -414,16 +414,16 @@ test("DateTime#toFormat('TTT') returns a medium time representation", () => {
});

test("DateTime#toFormat('f') returns a short date/time representation without seconds", () => {
expect(dt.toFormat("f")).toBe("5/25/1982, 9:23AM");
expect(dt.set({ hour: 13 }).toFormat("f")).toBe("5/25/1982, 1:23PM");
expect(dt.toFormat("f").replace(/\s+/g, " ")).toBe("5/25/1982, 9:23 AM");
expect(dt.set({ hour: 13 }).toFormat("f").replace(/\s+/g, " ")).toBe("5/25/1982, 1:23 PM");
expect(dt.reconfigure({ locale: "fr" }).toFormat("f")).toBe("25/05/1982 09:23");
expect(dt.set({ hour: 13 }).reconfigure({ locale: "fr" }).toFormat("f")).toBe("25/05/1982 13:23");
});

test("DateTime#toFormat('ff') returns a medium date/time representation without seconds", () => {
expect(dt.toFormat("ff")).toBe("May 25, 1982, 9:23AM");
expect(dt.set({ hour: 13 }).toFormat("ff")).toBe("May 25, 1982, 1:23PM");
expect(dt.set({ month: 8 }).toFormat("ff")).toBe("Aug 25, 1982, 9:23AM");
expect(dt.toFormat("ff").replace(/\s+/g, " ")).toBe("May 25, 1982, 9:23 AM");
expect(dt.set({ hour: 13 }).toFormat("ff").replace(/\s+/g, " ")).toBe("May 25, 1982, 1:23 PM");
expect(dt.set({ month: 8 }).toFormat("ff").replace(/\s+/g, " ")).toBe("Aug 25, 1982, 9:23 AM");
expect(dt.reconfigure({ locale: "fr" }).toFormat("ff")).toBe("25 mai 1982, 09:23");
expect(dt.set({ month: 2 }).reconfigure({ locale: "fr" }).toFormat("ff")).toBe(
"25 févr. 1982, 09:23"
Expand All @@ -434,9 +434,9 @@ test("DateTime#toFormat('ff') returns a medium date/time representation without
});

test("DateTime#toFormat('fff') returns a medium date/time representation without seconds", () => {
expect(ny.toFormat("fff")).toBe("May 25, 1982 at 9:23AM EDT");
expect(ny.set({ hour: 13 }).toFormat("fff")).toBe("May 25, 1982 at 1:23PM EDT");
expect(ny.set({ month: 8 }).toFormat("fff")).toBe("August 25, 1982 at 9:23AM EDT");
expect(ny.toFormat("fff")).toBe("May 25, 1982 at 9:23 AM EDT");
expect(ny.set({ hour: 13 }).toFormat("fff")).toBe("May 25, 1982 at 1:23 PM EDT");
expect(ny.set({ month: 8 }).toFormat("fff")).toBe("August 25, 1982 at 9:23 AM EDT");
expect(ny.reconfigure({ locale: "fr" }).toFormat("fff")).toBe("25 mai 1982 à 09:23 UTC−4");
expect(ny.set({ month: 2 }).reconfigure({ locale: "fr" }).toFormat("fff")).toBe(
"25 février 1982 à 09:23 UTC−5"
Expand All @@ -447,12 +447,12 @@ test("DateTime#toFormat('fff') returns a medium date/time representation without
});

test("DateTime#toFormat('ffff') returns a long date/time representation without seconds", () => {
expect(ny.toFormat("ffff")).toBe("Tuesday, May 25, 1982 at 9:23AM Eastern Daylight Time");
expect(ny.toFormat("ffff")).toBe("Tuesday, May 25, 1982 at 9:23 AM Eastern Daylight Time");
expect(ny.set({ hour: 13 }).toFormat("ffff")).toBe(
"Tuesday, May 25, 1982 at 1:23PM Eastern Daylight Time"
"Tuesday, May 25, 1982 at 1:23 PM Eastern Daylight Time"
);
expect(ny.set({ month: 2 }).toFormat("ffff")).toBe(
"Thursday, February 25, 1982 at 9:23AM Eastern Standard Time"
"Thursday, February 25, 1982 at 9:23 AM Eastern Standard Time"
);
expect(ny.reconfigure({ locale: "fr" }).toFormat("ffff")).toBe(
"mardi 25 mai 1982 à 09:23 heure d’été de l’Est nord-américain"
Expand All @@ -466,18 +466,18 @@ test("DateTime#toFormat('ffff') returns a long date/time representation without
});

test("DateTime#toFormat('F') returns a short date/time representation with seconds", () => {
expect(dt.toFormat("F")).toBe("5/25/1982, 9:23:54AM");
expect(dt.set({ hour: 13 }).toFormat("F")).toBe("5/25/1982, 1:23:54PM");
expect(dt.toFormat("F").replace(/\s+/g, " ")).toBe("5/25/1982, 9:23:54 AM");
expect(dt.set({ hour: 13 }).toFormat("F").replace(/\s+/g, " ")).toBe("5/25/1982, 1:23:54 PM");
expect(dt.reconfigure({ locale: "fr" }).toFormat("F")).toBe("25/05/1982 09:23:54");
expect(dt.set({ hour: 13 }).reconfigure({ locale: "fr" }).toFormat("F")).toBe(
"25/05/1982 13:23:54"
);
});

test("DateTime#toFormat('FF') returns a medium date/time representation with seconds", () => {
expect(dt.toFormat("FF")).toBe("May 25, 1982, 9:23:54AM");
expect(dt.set({ hour: 13 }).toFormat("FF")).toBe("May 25, 1982, 1:23:54PM");
expect(dt.set({ month: 8 }).toFormat("FF")).toBe("Aug 25, 1982, 9:23:54AM");
expect(dt.toFormat("FF").replace(/\s+/g, " ")).toBe("May 25, 1982, 9:23:54 AM");
expect(dt.set({ hour: 13 }).toFormat("FF").replace(/\s+/g, " ")).toBe("May 25, 1982, 1:23:54 PM");
expect(dt.set({ month: 8 }).toFormat("FF").replace(/\s+/g, " ")).toBe("Aug 25, 1982, 9:23:54 AM");
expect(dt.reconfigure({ locale: "fr" }).toFormat("FF")).toBe("25 mai 1982, 09:23:54");
expect(dt.set({ month: 2 }).reconfigure({ locale: "fr" }).toFormat("FF")).toBe(
"25 févr. 1982, 09:23:54"
Expand All @@ -488,9 +488,9 @@ test("DateTime#toFormat('FF') returns a medium date/time representation with sec
});

test("DateTime#toFormat('FFF') returns a medium date/time representation without seconds", () => {
expect(ny.toFormat("FFF")).toBe("May 25, 1982 at 9:23:54AM EDT");
expect(ny.set({ hour: 13 }).toFormat("FFF")).toBe("May 25, 1982 at 1:23:54PM EDT");
expect(ny.set({ month: 8 }).toFormat("FFF")).toBe("August 25, 1982 at 9:23:54AM EDT");
expect(ny.toFormat("FFF")).toBe("May 25, 1982 at 9:23:54 AM EDT");
expect(ny.set({ hour: 13 }).toFormat("FFF")).toBe("May 25, 1982 at 1:23:54 PM EDT");
expect(ny.set({ month: 8 }).toFormat("FFF")).toBe("August 25, 1982 at 9:23:54 AM EDT");
expect(ny.reconfigure({ locale: "fr" }).toFormat("FFF")).toBe("25 mai 1982 à 9:23:54 UTC−4");
expect(ny.set({ month: 2 }).reconfigure({ locale: "fr" }).toFormat("FFF")).toBe(
"25 février 1982 à 9:23:54 UTC−5"
Expand All @@ -501,12 +501,12 @@ test("DateTime#toFormat('FFF') returns a medium date/time representation without
});

test("DateTime#toFormat('FFFF') returns a long date/time representation without seconds", () => {
expect(ny.toFormat("FFFF")).toBe("Tuesday, May 25, 1982 at 9:23:54AM Eastern Daylight Time");
expect(ny.toFormat("FFFF")).toBe("Tuesday, May 25, 1982 at 9:23:54 AM Eastern Daylight Time");
expect(ny.set({ hour: 13 }).toFormat("FFFF")).toBe(
"Tuesday, May 25, 1982 at 1:23:54PM Eastern Daylight Time"
"Tuesday, May 25, 1982 at 1:23:54 PM Eastern Daylight Time"
);
expect(ny.set({ month: 2 }).toFormat("FFFF")).toBe(
"Thursday, February 25, 1982 at 9:23:54AM Eastern Standard Time"
"Thursday, February 25, 1982 at 9:23:54 AM Eastern Standard Time"
);
expect(ny.reconfigure({ locale: "fr" }).toFormat("FFFF")).toBe(
"mardi 25 mai 1982 à 9:23:54 heure d’été de l’Est nord-américain"
Expand Down

0 comments on commit e3d8031

Please sign in to comment.