@@ -26,6 +26,7 @@ interface AutoRunRuntimeTestsRunnerProps {
2626 autoRun : AutoRunConfig ;
2727 library : string ;
2828 forbidReanimated ?: boolean ;
29+ warmUp ?: ( ) => Promise < void > ;
2930}
3031
3132interface ProgressState {
@@ -50,6 +51,7 @@ export default function AutoRunRuntimeTestsRunner({
5051 autoRun,
5152 library,
5253 forbidReanimated,
54+ warmUp,
5355} : AutoRunRuntimeTestsRunnerProps ) {
5456 const [ component , setComponent ] = useState < ReactNode | null > ( null ) ;
5557 const [ status , setStatus ] = useState < string > (
@@ -98,10 +100,9 @@ export default function AutoRunRuntimeTestsRunner({
98100 } ) ;
99101
100102 const known = new Set ( tests . map ( ( test ) => test . testSuiteName ) ) ;
101- const unknown = [
102- ...( filterSet ?? [ ] ) ,
103- ...( includeSet ?? [ ] ) ,
104- ] . filter ( ( name ) => ! known . has ( name ) ) ;
103+ const unknown = [ ...( filterSet ?? [ ] ) , ...( includeSet ?? [ ] ) ] . filter (
104+ ( name ) => ! known . has ( name )
105+ ) ;
105106 if ( unknown . length > 0 ) {
106107 throw new Error ( `Unknown test suites: ${ unknown . join ( ', ' ) } ` ) ;
107108 }
@@ -125,6 +126,9 @@ export default function AutoRunRuntimeTestsRunner({
125126 render : setComponent ,
126127 onProgress : setProgress ,
127128 } ) ;
129+ if ( warmUp ) {
130+ await warmUp ( ) ;
131+ }
128132 const summary = await runTests ( ) ;
129133 if ( forbidReanimated && isReanimatedLoaded ( ) ) {
130134 summary . failed += 1 ;
@@ -140,7 +144,7 @@ export default function AutoRunRuntimeTestsRunner({
140144 cancelled = true ;
141145 teardown ( ) ;
142146 } ;
143- } , [ autoRun . wsUrl , tests , library , forbidReanimated ] ) ;
147+ } , [ autoRun . wsUrl , tests , library , forbidReanimated , warmUp ] ) ;
144148
145149 return (
146150 < View style = { styles . flexOne } >
0 commit comments