From 6c953a346ab889e735dd7e622580f0fadd7ea934 Mon Sep 17 00:00:00 2001 From: Storme-bit Date: Thu, 20 Aug 2026 05:07:53 -0700 Subject: [PATCH] test --- test/migrations.test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/migrations.test.js b/test/migrations.test.js index 653d878..d76dd91 100644 --- a/test/migrations.test.js +++ b/test/migrations.test.js @@ -4,6 +4,7 @@ // advance user_version correctly, and no-op when the DB is already current. const { test } = require('node:test'); const assert = require('node:assert'); +const Database = require('better-sqlite3'); const { migrate, LATEST_VERSION } = require('../packages/memory-service/src/db/migrations'); // Emulates just the slice of the better-sqlite3 API that migrate() uses. @@ -63,3 +64,10 @@ test('only migrations newer than the current version run', () => { assert.deepStrictEqual(order, ['v2', 'v3'], 'v1 is not re-run'); assert.deepStrictEqual(db.setCalls, [2, 3]); }); + +test('LATEST_VERSION reflects the appended v1 → v2 migration', () => { + // Guards that adding the access-tracking migration bumped the target version. + // The real SQL is verified out-of-band (scratch run against a DB copy); here we + // only lock the runner-visible contract: the array length drives LATEST_VERSION. + assert.strictEqual(LATEST_VERSION, 2); +});