@@ -194,14 +194,14 @@ const coreRenderProcessTestSuites = []
194
194
const testPath = path . join ( CONFIG . repositoryRootPath , 'spec' )
195
195
let testFiles = glob . sync ( path . join ( testPath , '*-spec.+(js|coffee|ts|jsx|tsx|mjs)' ) )
196
196
for ( let testFile of testFiles ) {
197
+ const testArguments = [
198
+ '--resource-path' , resourcePath ,
199
+ '--test' , testFile
200
+ ]
201
+ // the function which runs by async:
197
202
coreRenderProcessTestSuites . push ( function ( callback ) {
198
-
199
203
const testEnv = prepareEnv ( 'core-render-process' )
200
204
console . log ( `##[command] Executing core render process tests for ${ testFile } ` . bold . green )
201
- const testArguments = [
202
- '--resource-path' , resourcePath ,
203
- '--test' , testFile
204
- ]
205
205
spawnTest ( executablePath , testArguments , { env : testEnv } , callback , `core-render-process in ${ testFile } .` )
206
206
} )
207
207
}
@@ -230,15 +230,17 @@ for (let packageName in CONFIG.appMetadata.packageDependencies) {
230
230
231
231
const testFolder = path . join ( repositoryPackagePath , testSubdir )
232
232
233
+ const testArguments = [
234
+ '--resource-path' , resourcePath ,
235
+ '--test' , testFolder
236
+ ]
237
+
238
+ const pkgJsonPath = path . join ( repositoryPackagePath , 'package.json' )
239
+ const nodeModulesPath = path . join ( repositoryPackagePath , 'node_modules' )
240
+
241
+ // the function which runs by async:
233
242
packageTestSuites . push ( function ( callback ) {
234
- const testArguments = [
235
- '--resource-path' , resourcePath ,
236
- '--test' , testFolder
237
- ]
238
243
const testEnv = prepareEnv ( `bundled-package-${ packageName } ` )
239
-
240
- const pkgJsonPath = path . join ( repositoryPackagePath , 'package.json' )
241
- const nodeModulesPath = path . join ( repositoryPackagePath , 'node_modules' )
242
244
let finalize = ( ) => null
243
245
if ( require ( pkgJsonPath ) . atomTestRunner ) {
244
246
console . log ( `##[command] Installing test runner dependencies for ${ packageName } ` . bold . green )
@@ -359,7 +361,7 @@ async.series(testSuitesToRun, function (err, results) {
359
361
const failedSteps = results . filter ( ( { exitCode} ) => exitCode !== 0 )
360
362
361
363
if ( failedSteps . length > 0 ) {
362
- console . warn ( "\n \n ##[error] *** Reporting the errors that happened in all of the tests: *** \n \n" )
364
+ console . warn ( "\n \n ##[error] *** Reporting the errors that happened in all of the tests: *** \n \n" )
363
365
for ( const { step, testCommand} of failedSteps ) {
364
366
console . error ( `##[error] The '${ step } ' test step finished with a non-zero exit code \n ${ testCommand } ` )
365
367
}
0 commit comments