Fix date related tests
This commit is contained in:
parent
4ac3102f2a
commit
5933422a79
|
@ -1,3 +1,6 @@
|
||||||
|
const tk = require( "timekeeper")
|
||||||
|
tk.freeze(Date.now())
|
||||||
|
|
||||||
// Mock out postgres for this
|
// Mock out postgres for this
|
||||||
jest.mock("pg")
|
jest.mock("pg")
|
||||||
jest.mock("node-fetch")
|
jest.mock("node-fetch")
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
const tk = require( "timekeeper")
|
||||||
|
const timestamp = new Date("2023-01-26T11:48:57.597Z").toISOString()
|
||||||
|
tk.freeze(timestamp)
|
||||||
|
|
||||||
|
|
||||||
const { outputProcessing } = require("../../../utilities/rowProcessor")
|
const { outputProcessing } = require("../../../utilities/rowProcessor")
|
||||||
const setup = require("./utilities")
|
const setup = require("./utilities")
|
||||||
const { basicRow } = setup.structures
|
const { basicRow } = setup.structures
|
||||||
|
@ -111,8 +116,8 @@ describe("/rows", () => {
|
||||||
_id: existing._id,
|
_id: existing._id,
|
||||||
_rev: existing._rev,
|
_rev: existing._rev,
|
||||||
type: "row",
|
type: "row",
|
||||||
createdAt: "2020-01-01T00:00:00.000Z",
|
createdAt: timestamp,
|
||||||
updatedAt: "2020-01-01T00:00:00.000Z",
|
updatedAt: timestamp,
|
||||||
})
|
})
|
||||||
await assertQueryUsage(queryUsage + 1)
|
await assertQueryUsage(queryUsage + 1)
|
||||||
})
|
})
|
||||||
|
|
|
@ -25,10 +25,6 @@ const clearMigrations = async () => {
|
||||||
|
|
||||||
jest.setTimeout(10000)
|
jest.setTimeout(10000)
|
||||||
|
|
||||||
afterAll(() => {
|
|
||||||
tk.reset()
|
|
||||||
})
|
|
||||||
|
|
||||||
describe("migrations", () => {
|
describe("migrations", () => {
|
||||||
const config = new TestConfig()
|
const config = new TestConfig()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue