Add test for migration disabling.
This commit is contained in:
parent
80ddadbe06
commit
3cf3588192
|
@ -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)
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue