From 4187a544a576eadcf96764c3004aa6a14a698cf6 Mon Sep 17 00:00:00 2001 From: Luiz Ferraz Date: Tue, 15 Sep 2026 01:58:42 +0000 Subject: [PATCH] fix(ci): stabilize flaky shiki test and knip entry - Mock Date.now in shiki highlighter test so CI contention can't truncate tokenization - Register smoke-cli-archive.ts as a knip entry since release workflows don't run in this fork --- .../src/features/review/shikiReviewHighlighter.test.ts | 5 ++++- knip.jsonc | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/mobile/src/features/review/shikiReviewHighlighter.test.ts b/apps/mobile/src/features/review/shikiReviewHighlighter.test.ts index cfb28051cb12..140cffc2ad63 100644 --- a/apps/mobile/src/features/review/shikiReviewHighlighter.test.ts +++ b/apps/mobile/src/features/review/shikiReviewHighlighter.test.ts @@ -47,11 +47,14 @@ describe("highlightSourceFile", () => { ]); }); - it("initializes source and snippet highlighting without a warmup", async () => { + it("initializes source and snippet highlighting without a warmup", async ({ onTestFinished }) => { vi.resetModules(); const highlighter = await import("./shikiReviewHighlighter"); const source = "const answer: number = 42;"; + // Shiki bounds tokenization by wall time; CI contention must not truncate this fixture. + const clockSpy = vi.spyOn(Date, "now").mockReturnValue(0); + onTestFinished(() => clockSpy.mockRestore()); const highlighted = await highlighter.highlightSourceFile({ path: "example.ts", contents: source, diff --git a/knip.jsonc b/knip.jsonc index d203e6405585..141dfd40f16e 100644 --- a/knip.jsonc +++ b/knip.jsonc @@ -14,7 +14,8 @@ }, "scripts": { // Knip loads its preprocessor through a CLI option, not a source import. - "entry": ["knip-schemas.ts"], + // The CLI archive smoke tool is run manually in this fork, without release workflows. + "entry": ["knip-schemas.ts", "smoke-cli-archive.ts"], }, "apps/server": { // Vite+ pack entries and the launcher used by installed background services.