Skip to content

Commit

Permalink
fix: modify testing timezone to UTC
Browse files Browse the repository at this point in the history
  • Loading branch information
cancue committed Apr 24, 2024
1 parent 29e626c commit b732bbb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"build": "npm run build-iframe && tsc",
"lint": "eslint .",
"lint-fix": "eslint . --fix",
"test": "jest",
"test-cover": "jest --coverage",
"test-watch": "jest --watchAll=true",
"test-watch-cover": "jest --coverage --watchAll=true",
"test": "TZ=UTC jest",
"test-cover": "TZ=UTC jest --coverage",
"test-watch": "TZ=UTC jest --watchAll=true",
"test-watch-cover": "TZ=UTC jest --coverage --watchAll=true",
"prepare": "npm run build",
"pretest": "tsc",
"posttest": "npm run lint",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ describe("formula evaluator", () => {

beforeAll(() => {
testDI(stateData)
process.env.TZ = "UTC"
subject = new FormulaEvaluator()
})

Expand Down Expand Up @@ -225,7 +226,7 @@ describe("formula evaluator", () => {
NBDBString.toData(
subject.startDate(["", ["fromTimestamp", "1641300863123"]])
)
).toBe("2022-01-04T21:54")
).toBe("2022-01-04T12:54")
expect(subject.startDate(["", true]).D).toBe(null)
})

Expand All @@ -251,13 +252,13 @@ describe("formula evaluator", () => {

it("timestamp", () => {
expect(subject.timestamp(["", "2022-01-08T01:02"]).S).toBe(
"1641571320000"
"1641603720000"
)
})

it("fromTimestamp", () => {
expect(
NBDBString.toData(subject.fromTimestamp(["", "1641571320000"]))
NBDBString.toData(subject.fromTimestamp(["", "1641603720000"]))
).toBe("2022-01-08T01:02")
})

Expand Down

0 comments on commit b732bbb

Please sign in to comment.