Resetting timekeeper and resetting pro back to normal.
This commit is contained in:
parent
15b1f3efe6
commit
88cc8a19ee
|
@ -1,7 +1,3 @@
|
||||||
export const MOCK_DATE = new Date("2020-01-01T00:00:00.000Z")
|
export const MOCK_DATE = new Date("2020-01-01T00:00:00.000Z")
|
||||||
|
|
||||||
export const MOCK_DATE_PLUS = (ms: number) => {
|
|
||||||
return new Date(Date.now() + ms)
|
|
||||||
}
|
|
||||||
|
|
||||||
export const MOCK_DATE_TIMESTAMP = 1577836800000
|
export const MOCK_DATE_TIMESTAMP = 1577836800000
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 132b080643f0b1ef1488bb8362d1c41ea0bd263f
|
Subproject commit 3820c0c93a3e448e10a60a9feb5396844b537ca8
|
|
@ -14,6 +14,7 @@ describe("/backups", () => {
|
||||||
afterAll(setup.afterAll)
|
afterAll(setup.afterAll)
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
|
tk.reset()
|
||||||
await config.init()
|
await config.init()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,6 @@ import {
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
import TestConfiguration from "../TestConfiguration"
|
import TestConfiguration from "../TestConfiguration"
|
||||||
import { TestAPI } from "./base"
|
import { TestAPI } from "./base"
|
||||||
import tk from "timekeeper"
|
|
||||||
import { mocks } from "@budibase/backend-core/tests"
|
|
||||||
|
|
||||||
export class BackupAPI extends TestAPI {
|
export class BackupAPI extends TestAPI {
|
||||||
constructor(config: TestConfiguration) {
|
constructor(config: TestConfiguration) {
|
||||||
|
@ -25,7 +23,6 @@ export class BackupAPI extends TestAPI {
|
||||||
}
|
}
|
||||||
|
|
||||||
createBackup = async (appId: string) => {
|
createBackup = async (appId: string) => {
|
||||||
tk.freeze(mocks.date.MOCK_DATE_PLUS(1))
|
|
||||||
const result = await this.request
|
const result = await this.request
|
||||||
.post(`/api/apps/${appId}/backups`)
|
.post(`/api/apps/${appId}/backups`)
|
||||||
.set(this.config.defaultHeaders())
|
.set(this.config.defaultHeaders())
|
||||||
|
@ -38,7 +35,6 @@ export class BackupAPI extends TestAPI {
|
||||||
appId: string,
|
appId: string,
|
||||||
backupId: string
|
backupId: string
|
||||||
): Promise<ImportAppBackupResponse> => {
|
): Promise<ImportAppBackupResponse> => {
|
||||||
tk.freeze(mocks.date.MOCK_DATE_PLUS(1))
|
|
||||||
const result = await this.request
|
const result = await this.request
|
||||||
.post(`/api/apps/${appId}/backups/${backupId}/import`)
|
.post(`/api/apps/${appId}/backups/${backupId}/import`)
|
||||||
.set(this.config.defaultHeaders())
|
.set(this.config.defaultHeaders())
|
||||||
|
|
Loading…
Reference in New Issue