1
0
Fork 0
mirror of synced 2024-08-04 21:02:01 +12:00

Add test for migration disabling.

This commit is contained in:
mike12345567 2024-06-05 17:09:46 +01:00
parent 80ddadbe06
commit 3cf3588192

View file

@ -1,6 +1,7 @@
import { Header } from "@budibase/backend-core"
import * as setup from "../../api/routes/tests/utilities"
import * as migrations from "../migrations"
import { migrationsEnabled } from "../index"
import { getAppMigrationVersion } from "../appMigrationMetadata"
jest.mock<typeof migrations>("../migrations", () => ({
@ -52,4 +53,14 @@ describe("migrations", () => {
},
})
})
it("should disable migrations if any migration is disabled", () => {
migrations.MIGRATIONS.push({
id: "20231211105814_new-test",
func: async () => {},
disabled: true,
})
expect(migrationsEnabled()).toBe(false)
})
})