@@ -56,20 +56,31 @@ import { VScodeScripts } from './helpers/scripts/vscodeScripts'
56
56
} )
57
57
}
58
58
59
- let testFilesEnv : string | string [ ] = process . env . TEST_FILES ! ;
59
+ let testFilesEnv : string | string [ ] = process . env . TEST_FILES !
60
60
if ( process . env . TEST_FILES ) {
61
- testFilesEnv = process . env . TEST_FILES . split ( ' ' ) . map ( ( file ) => {
62
- return path . join ( __dirname , '..' , 'dist' , file ) ;
63
- } ) ;
64
-
65
- console . log ( 'Full Paths:' , testFilesEnv ) ;
61
+ testFilesEnv = process . env . TEST_FILES . split ( ' ' ) . map ( file => {
62
+ return path . join ( __dirname , '..' , 'dist' , file )
63
+ } )
64
+
65
+ // Always prepend setup.js
66
+ const setupTestPath = path . join (
67
+ __dirname ,
68
+ '..' ,
69
+ 'dist' ,
70
+ 'tests' ,
71
+ 'setup.js' ,
72
+ )
73
+ testFilesEnv . unshift ( setupTestPath )
74
+
75
+ console . log ( 'Full Paths:' , testFilesEnv )
66
76
} else {
67
- console . error ( 'TEST_FILES environment variable is not defined.' ) ;
77
+ console . error ( 'TEST_FILES environment variable is not defined.' )
68
78
}
69
79
70
80
// Run tests
71
81
await exTester . runTests (
72
- testFilesEnv || path . join ( __dirname , '..' , 'dist' , 'tests' , '**' , '*.e2e.js' ) ,
82
+ testFilesEnv ||
83
+ path . join ( __dirname , '..' , 'dist' , 'tests' , '**' , '*.e2e.js' ) ,
73
84
{
74
85
settings : 'settings.json' ,
75
86
logLevel : logging . Level . INFO ,
0 commit comments