Updating app migration test to not create the app context, relying on the app migration processor to do this for us instead (including tenancy context).
This commit is contained in:
parent
9e3f476c65
commit
aadf8ff3b3
|
@ -16,7 +16,17 @@ import {
|
||||||
generateLinkID,
|
generateLinkID,
|
||||||
generateRowID,
|
generateRowID,
|
||||||
} from "../../../db/utils"
|
} from "../../../db/utils"
|
||||||
|
import { processMigrations } from "../../migrationsProcessor"
|
||||||
import migration from "../20240604153647_initial_sqs"
|
import migration from "../20240604153647_initial_sqs"
|
||||||
|
import { AppMigration } from "src/appMigrations"
|
||||||
|
|
||||||
|
const MIGRATIONS: AppMigration[] = [
|
||||||
|
{
|
||||||
|
id: "20240604153647_initial_sqs",
|
||||||
|
func: migration,
|
||||||
|
disabled: false,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
const config = setup.getConfig()
|
const config = setup.getConfig()
|
||||||
let tableId: string
|
let tableId: string
|
||||||
|
@ -91,9 +101,7 @@ describe("SQS migration", () => {
|
||||||
expect(error.status).toBe(404)
|
expect(error.status).toBe(404)
|
||||||
})
|
})
|
||||||
await sqsEnabled(async () => {
|
await sqsEnabled(async () => {
|
||||||
await context.doInAppContext(config.appId!, async () => {
|
await processMigrations(config.appId!, MIGRATIONS)
|
||||||
await migration()
|
|
||||||
})
|
|
||||||
const designDoc = await db.get<SQLiteDefinition>(SQLITE_DESIGN_DOC_ID)
|
const designDoc = await db.get<SQLiteDefinition>(SQLITE_DESIGN_DOC_ID)
|
||||||
expect(designDoc.sql.tables).toBeDefined()
|
expect(designDoc.sql.tables).toBeDefined()
|
||||||
const mainTableDef = designDoc.sql.tables[tableId]
|
const mainTableDef = designDoc.sql.tables[tableId]
|
||||||
|
|
Loading…
Reference in New Issue