@@ -33,26 +33,30 @@ describe.each(['app', 'pages'] as const)(
33
33
// eslint: ['--eslint', '--no-linter'],
34
34
eslint : [ '--eslint' ] ,
35
35
36
- srcDir : [ '--src-dir' , '--no-src-dir' ] ,
36
+ // Trading test perf for robustness:
37
+ // srcDir and reactCompiler don't interact so we're testing them together
38
+ // instead of all permutations.
39
+ srcDirAndCompiler : [
40
+ '--src-dir --react-compiler' ,
41
+ '--no-src-dir --no-react-compiler' ,
42
+ ] ,
37
43
tailwind : [ '--tailwind' , '--no-tailwind' ] ,
38
44
39
45
// shouldn't affect if the app builds or not
40
46
// packageManager: ['--use-npm', '--use-pnpm', '--use-yarn', '--use-bun'],
41
-
42
- reactCompiler : [ '--react-compiler' , '--no-react-compiler' ] ,
43
47
}
44
48
45
- const getPermutations = < T > ( items : T [ ] [ ] ) : T [ ] [ ] => {
49
+ const getCombinations = ( items : string [ ] [ ] ) : string [ ] [ ] => {
46
50
if ( ! items . length ) return [ [ ] ]
47
51
const [ first , ...rest ] = items
48
- const children = getPermutations ( rest )
52
+ const children = getCombinations ( rest )
49
53
return first . flatMap ( ( value ) =>
50
- children . map ( ( child ) => [ value , ...child ] )
54
+ children . map ( ( child ) => [ ... value . split ( ' ' ) , ...child ] )
51
55
)
52
56
}
53
57
54
- const flagPermutations = getPermutations ( Object . values ( allFlagValues ) )
55
- const testCases = flagPermutations . map ( ( flags ) => ( {
58
+ const flagCombinations = getCombinations ( Object . values ( allFlagValues ) )
59
+ const testCases = flagCombinations . map ( ( flags ) => ( {
56
60
name : flags . join ( ' ' ) ,
57
61
flags,
58
62
} ) )
0 commit comments