diff --git a/tests/ci/audit-closed-references.test.js b/tests/ci/audit-closed-references.test.js index 050c2bed6..6c39eca72 100644 --- a/tests/ci/audit-closed-references.test.js +++ b/tests/ci/audit-closed-references.test.js @@ -176,12 +176,14 @@ function run() { check('CLI fixture: page-two issue is audited and failed comments report incomplete', () => { const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'audit-cli-')); const stub = path.join(tmp, 'stub-gh.js'); + // The CLI reads the real clock, so keep its fixture inside the audit window. + const recentClosedAt = new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString(); fs.writeFileSync(stub, ` const args = process.argv.slice(2); const url = args.find((a) => a.includes('/issues?state=closed')) || ''; if (url) { - const page1 = [{ number: 1, state: 'closed', closed_at: '2026-10-11T00:00:00Z', html_url: 'u1', title: 'a', body: 'no refs here' }]; - const page2 = [{ number: 88, state: 'closed', closed_at: '2026-10-11T00:00:00Z', html_url: 'u88', title: 'page two', body: 'no refs either' }]; + const page1 = [{ number: 1, state: 'closed', closed_at: ${JSON.stringify(recentClosedAt)}, html_url: 'u1', title: 'a', body: 'no refs here' }]; + const page2 = [{ number: 88, state: 'closed', closed_at: ${JSON.stringify(recentClosedAt)}, html_url: 'u88', title: 'page two', body: 'no refs either' }]; process.stdout.write(JSON.stringify([page1, page2])); return; } @@ -190,7 +192,7 @@ function run() { process.exit(1); } if (args.some((a) => a.includes('/issues/1/comments'))) { - process.stdout.write(JSON.stringify([{ body: 'Delivered through #3500', html_url: 'c1', created_at: '2026-10-11T00:00:00Z' }])); + process.stdout.write(JSON.stringify([{ body: 'Delivered through #3500', html_url: 'c1', created_at: ${JSON.stringify(recentClosedAt)} }])); return; } if (args.some((a) => a.includes('/pulls/'))) {