Skip to content

Commit 0dad79c

Browse files
t3dotggclaude
andcommitted
test(web): give ChatView's React Compiler check a 60s timeout
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 61e2747 commit 0dad79c

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

‎apps/web/src/reactCompilerCoverage.test.ts‎

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,24 @@ const webSourceFiles = NodeFS.readdirSync(NodePath.join(repoRoot, "apps/web/src"
1818
.filter((file) => !file.endsWith(".gen.ts"))
1919
.map((file) => `apps/web/src/${file}`);
2020

21+
// ChatView is ~9k lines. Compiling it takes ~9s on a fast machine and passes the
22+
// 15s project timeout on loaded CI runners.
23+
const slowFiles = new Set(["apps/web/src/components/ChatView.tsx"]);
24+
25+
const compile = async (file: string) => {
26+
const absolute = NodePath.join(repoRoot, file);
27+
const result = await transform(absolute, NodeFS.readFileSync(absolute, "utf8"), {
28+
jsx: { runtime: "automatic", development: false, refresh: false },
29+
reactCompiler: { reportDiagnostics: true },
30+
});
31+
const bailouts = result.errors.map((error) => error.codeframe ?? error.message);
32+
expect(bailouts).toEqual([]);
33+
};
34+
2135
// Lint reports most compiler bailouts, but not every one (try/finally, throw
2236
// inside try). A skipped file still builds, just unmemoized, so check the output.
2337
describe("React Compiler coverage", () => {
24-
it.each(webSourceFiles)("compiles %s", async (file) => {
25-
const absolute = NodePath.join(repoRoot, file);
26-
const result = await transform(absolute, NodeFS.readFileSync(absolute, "utf8"), {
27-
jsx: { runtime: "automatic", development: false, refresh: false },
28-
reactCompiler: { reportDiagnostics: true },
29-
});
30-
const bailouts = result.errors.map((error) => error.codeframe ?? error.message);
31-
expect(bailouts).toEqual([]);
32-
});
38+
it.each(webSourceFiles.filter((file) => !slowFiles.has(file)))("compiles %s", compile);
39+
// oxlint-disable-next-line t3code/no-test-timeout-or-unreasoned-skip -- CPU-bound compile of a huge file, not a hidden wait.
40+
it.each([...slowFiles])("compiles %s", compile, 60_000);
3341
});

0 commit comments

Comments
 (0)