From aadf8ff3b3ebf6005fbd8b01941e77a952f396fe Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 10 Jun 2024 13:55:26 +0100 Subject: [PATCH] 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). --- .../tests/20240604153647_initial_sqs.spec.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/server/src/appMigrations/migrations/tests/20240604153647_initial_sqs.spec.ts b/packages/server/src/appMigrations/migrations/tests/20240604153647_initial_sqs.spec.ts index 64420d239f..49aef4c310 100644 --- a/packages/server/src/appMigrations/migrations/tests/20240604153647_initial_sqs.spec.ts +++ b/packages/server/src/appMigrations/migrations/tests/20240604153647_initial_sqs.spec.ts @@ -16,7 +16,17 @@ import { generateLinkID, generateRowID, } from "../../../db/utils" +import { processMigrations } from "../../migrationsProcessor" 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() let tableId: string @@ -91,9 +101,7 @@ describe("SQS migration", () => { expect(error.status).toBe(404) }) await sqsEnabled(async () => { - await context.doInAppContext(config.appId!, async () => { - await migration() - }) + await processMigrations(config.appId!, MIGRATIONS) const designDoc = await db.get(SQLITE_DESIGN_DOC_ID) expect(designDoc.sql.tables).toBeDefined() const mainTableDef = designDoc.sql.tables[tableId]