diff options
Diffstat (limited to 'tests/js/accretion.mjs')
-rw-r--r-- | tests/js/accretion.mjs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/js/accretion.mjs b/tests/js/accretion.mjs index 3ea90c3..a0fbb66 100644 --- a/tests/js/accretion.mjs +++ b/tests/js/accretion.mjs @@ -2,27 +2,29 @@ import assert from "node:assert/strict"; import sqlite from "../../src/sqlite.cjs"; -import { runTests } from "../runner.mjs"; -import { promisifyDb, open } from "../../src/db.mjs"; -import { runMigrations } from "../../src/accretion.mjs"; +import * as runner from "../runner.mjs"; +import * as db from "../../src/db.mjs"; +import { + runMigrations, +} from "../../src/accretion.mjs"; const test_runMigrations = t => { t.start("runMigrations()"); t.test("running twice is a noop", async () => { - const db = await open(":memory:"); - const migrationsFn = () => db.all("SELECT filename FROM migrations;"); + const handle = await db.open(":memory:"); + const migrationsFn = () => handle.all("SELECT filename FROM migrations;"); assert.rejects( migrationsFn, { message: "SQLITE_ERROR: no such table: migrations" }, ); - await runMigrations(db); + await runMigrations(handle); const filled = await migrationsFn(); - await runMigrations(db); + await runMigrations(handle); const unchanged = await migrationsFn(); assert.deepEqual(filled, unchanged); @@ -30,6 +32,6 @@ const test_runMigrations = t => { }; -await runTests([ +await runner.runTests([ test_runMigrations, ]); |