Make migration-report test robust to symlinked tmpdir
The rollback pack canonicalizes the source path via realpathSync.native (correct: it resolves symlinks before comparing). On macOS tmpdir() is /var → /private/var, so the test's raw legacyPath never matched. Compare against the canonical path instead. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
1fa1990abb
commit
56dbca3bf7
1 file changed
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { mkdirSync, rmSync, writeFileSync } from "node:fs";
|
||||
import { mkdirSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { tmpdir } from "node:os";
|
||||
import { createHash, randomUUID } from "node:crypto";
|
||||
@@ -580,7 +580,7 @@ describe("domain services", () => {
|
||||
expect(report.failures.some((failure) => failure.reason === "missing_table")).toBe(true);
|
||||
expect(report.validationSummary.missingTableCount).toBeGreaterThan(0);
|
||||
expect(report.validationSummary.passed).toBe(false);
|
||||
expect(report.rollbackPack.sourceDatabasePath).toBe(legacyPath);
|
||||
expect(report.rollbackPack.sourceDatabasePath).toBe(realpathSync.native(legacyPath));
|
||||
connection.close();
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user