Skip to content

Commit 95da305

Browse files
committed
test: Ensures that migrations are only processed once.
1 parent f83840e commit 95da305

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/rollbackByKey/test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@ const testRollbackByKey: TestFactory = (createService) => {
7272
service.rollbackByKey({ key: testMigrationKey }),
7373
]);
7474
});
75+
76+
it('should only rollback a migration once when its migrated more than once', async () => {
77+
const service = createService([createTestDownMigration()]);
78+
await service.migrate();
79+
await service.migrateByKey({ key: testMigrationKey, force: true });
80+
await service.rollback();
81+
const promise = service.rollbackByKey({ key: testMigrationKey });
82+
await assertRejects(promise, UnprocessedMigrationError);
83+
});
7584
});
7685
};
7786

0 commit comments

Comments
 (0)