@@ -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.
2337describe ( "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