diff --git a/lib/__tests__/video-transcode-deploy-drain.test.ts b/lib/__tests__/video-transcode-deploy-drain.test.ts index fa04f4f..bd373b1 100644 --- a/lib/__tests__/video-transcode-deploy-drain.test.ts +++ b/lib/__tests__/video-transcode-deploy-drain.test.ts @@ -53,7 +53,8 @@ describe('production video transcode drain gate', () => { let script: string beforeAll(async () => { - script = await readFile(path.join(process.cwd(), 'scripts/git-incremental-deploy.ps1'), 'utf8') + script = (await readFile(path.join(process.cwd(), 'scripts/git-incremental-deploy.ps1'), 'utf8')) + .replace(/\r\n/g, '\n') }) test('先设置旧容器两类后台 worker drain 并确认 inactive,再启动候选容器', () => { diff --git a/scripts/legacy-worker-bootstrap-deploy.test.mjs b/scripts/legacy-worker-bootstrap-deploy.test.mjs index 8100bd6..b71b7cf 100644 --- a/scripts/legacy-worker-bootstrap-deploy.test.mjs +++ b/scripts/legacy-worker-bootstrap-deploy.test.mjs @@ -6,7 +6,7 @@ import { spawnSync } from 'node:child_process' import test from 'node:test' const scriptPath = path.join(process.cwd(), 'scripts', 'legacy-worker-bootstrap-deploy.ps1') -const script = readFileSync(scriptPath, 'utf8') +const script = readFileSync(scriptPath, 'utf8').replace(/\r\n/g, '\n') function indexAfter(needle, after = 0) { const index = script.indexOf(needle, after) diff --git a/scripts/safe-production-migrate.test.mjs b/scripts/safe-production-migrate.test.mjs index b955ece..78c05e0 100644 --- a/scripts/safe-production-migrate.test.mjs +++ b/scripts/safe-production-migrate.test.mjs @@ -298,7 +298,8 @@ test('SOP extracts the exact receipt basename and hash from a real helper result `${JSON.stringify(result, null, 2)}\nProduction backup was created, restored to the isolated server and verified.\n`, ) - const sop = await readFile(new URL('../docs/生产数据库安全增量迁移SOP-2026-08-12.md', import.meta.url), 'utf8') + const sop = (await readFile(new URL('../docs/生产数据库安全增量迁移SOP-2026-08-12.md', import.meta.url), 'utf8')) + .replace(/\r\n/g, '\n') const startMarker = 'node --input-type=commonjs - "$HOST_RESULT_FILE" "$HOST_BACKUP_DIR" <<\'NODE\'\n' const start = sop.indexOf(startMarker) assert.ok(start >= 0, 'SOP evidence extraction Node block is missing')