Fix date related tests

This commit is contained in:
Adria Navarro Redo 2023-01-26 11:55:11 +00:00 committed by adrinr
parent 6a4fe1d5e6
commit 8c1e539fc7
3 changed files with 10 additions and 6 deletions

View File

@ -1,3 +1,6 @@
const tk = require( "timekeeper")
tk.freeze(Date.now())
// Mock out postgres for this
jest.mock("pg")
jest.mock("node-fetch")

View File

@ -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 setup = require("./utilities")
const { basicRow } = setup.structures
@ -111,8 +116,8 @@ describe("/rows", () => {
_id: existing._id,
_rev: existing._rev,
type: "row",
createdAt: "2020-01-01T00:00:00.000Z",
updatedAt: "2020-01-01T00:00:00.000Z",
createdAt: timestamp,
updatedAt: timestamp,
})
await assertQueryUsage(queryUsage + 1)
})

View File

@ -25,10 +25,6 @@ const clearMigrations = async () => {
jest.setTimeout(10000)
afterAll(() => {
tk.reset()
})
describe("migrations", () => {
const config = new TestConfig()