@@ -114,20 +114,6 @@ function createCompiler(webpack, config, appName, urls, useYarn, useTypeScript,
114
114
process . exit ( 1 ) ;
115
115
}
116
116
117
- // You can safely remove this after ejecting.
118
- // We only use this block for testing of Create React App itself:
119
- const isSmokeTest = process . argv . some ( arg => arg . indexOf ( '--smoke-test' ) > - 1 ) ;
120
- if ( isSmokeTest ) {
121
- compiler . hooks . failed . tap ( 'smokeTest' , ( ) => process . exit ( 1 ) ) ;
122
- compiler . hooks . done . tap ( 'smokeTest' , stats => {
123
- if ( stats . hasErrors ( ) || stats . hasWarnings ( ) ) {
124
- process . exit ( 1 ) ;
125
- } else {
126
- process . exit ( 0 ) ;
127
- }
128
- } ) ;
129
- }
130
-
131
117
// "invalid" event fires when you have changed a file, and Webpack is
132
118
// recompiling a bundle. WebpackDevServer takes care to pause serving the
133
119
// bundle, so if you refresh, it'll wait instead of serving the old one.
@@ -240,6 +226,25 @@ function createCompiler(webpack, config, appName, urls, useYarn, useTypeScript,
240
226
) ;
241
227
}
242
228
} ) ;
229
+
230
+ // You can safely remove this after ejecting.
231
+ // We only use this block for testing of Create React App itself:
232
+ const isSmokeTest = process . argv . some ( arg => arg . indexOf ( '--smoke-test' ) > - 1 ) ;
233
+ if ( isSmokeTest ) {
234
+ compiler . hooks . failed . tap ( 'smokeTest' , async ( ) => {
235
+ await tsMessagesPromise ;
236
+ process . exit ( 1 )
237
+ } ) ;
238
+ compiler . hooks . done . tap ( 'smokeTest' , async stats => {
239
+ await tsMessagesPromise ;
240
+ if ( stats . hasErrors ( ) || stats . hasWarnings ( ) ) {
241
+ process . exit ( 1 ) ;
242
+ } else {
243
+ process . exit ( 0 ) ;
244
+ }
245
+ } ) ;
246
+ }
247
+
243
248
return compiler ;
244
249
}
245
250
0 commit comments