Files
insforge--insforge/backend/tests/unit/migration-duplicate-numbers.test.ts
wehub-resource-sync 3a28426bf4
Lint and Format Check / lint-and-format (push) Failing after 0s
Check Migrations / Check for duplicate migration numbers (push) Failing after 1s
CI Pre-merge Check / CI Pre-merge Check (push) Failing after 2m17s
chore: import upstream snapshot with attribution
2026-07-13 12:23:40 +08:00

25 lines
797 B
TypeScript

import { describe, it, expect } from 'vitest';
import {
findDuplicateMigrations,
ALLOWED_DUPLICATES,
} from '../../scripts/check-migration-duplicates.js';
describe('migration numbers', () => {
it('has no duplicate numbers except the grandfathered 033 and 047', () => {
const { newDuplicates } = findDuplicateMigrations();
// newDuplicates excludes ALLOWED_DUPLICATES (033, 047). Anything here is a
// real collision that must be renumbered before merging.
expect(
newDuplicates,
`Duplicate migration number(s): ${newDuplicates
.map((d) => `${d.prefix} (${d.files.join(', ')})`)
.join('; ')}`
).toEqual([]);
});
it('grandfathers exactly 033 and 047', () => {
expect([...ALLOWED_DUPLICATES].sort()).toEqual(['033', '047']);
});
});