feat(planner): add bridge target version strategy for auto-stamping ledger to app versions

This commit is contained in:
2026-05-19 21:44:57 +00:00
parent c04a094723
commit b3078029e3
8 changed files with 250 additions and 3 deletions
+15
View File
@@ -145,6 +145,21 @@ tap.test('constructor: rejects s3 backend without bucket', async () => {
expect(caught!.code).toEqual('LEDGER_BACKEND_MISMATCH');
});
tap.test('constructor: rejects invalid targetVersionStrategy', async () => {
let caught: SmartMigrationError | undefined;
try {
new SmartMigration({
targetVersion: '1.0.0',
db: {} as any,
targetVersionStrategy: 'loose' as any,
});
} catch (err) {
caught = err as SmartMigrationError;
}
expect(caught).toBeInstanceOf(SmartMigrationError);
expect(caught!.code).toEqual('INVALID_TARGET_VERSION_STRATEGY');
});
tap.test('step(): rejects empty id', async () => {
const m = new SmartMigration({ targetVersion: '1.0.0', db: {} as any });
expect(() => m.step('')).toThrow();