@@ -22,7 +22,7 @@ process.env.TZ = 'US/Pacific'
2222export async function runTests (
2323 testFolder : string ,
2424 initTests : string [ ] = [ ] ,
25- extensionId : string = VSCODE_EXTENSION_ID . awstoolkitcore ,
25+ extensionId : string = VSCODE_EXTENSION_ID . awstoolkit ,
2626 testFiles ?: string [ ]
2727) : Promise < void > {
2828 if ( ! process . env [ 'AWS_TOOLKIT_AUTOMATION' ] ) {
@@ -36,6 +36,9 @@ export async function runTests(
3636 }
3737
3838 /**
39+ * Retaining this because it may be relevant in the future for lib-only tests. For now,
40+ * all tests are ran from a subproject/extension.
41+ *
3942 * Node's `require` caches modules by case-sensitive paths, regardless of the underlying
4043 * file system. This is normally not a problem, but VS Code also happens to normalize paths
4144 * on Windows to use lowercase drive letters when using its bootstrap loader. This means
@@ -59,12 +62,7 @@ export async function runTests(
5962 * lower case module ids (since the tests live inside of core itself)
6063 */
6164 const [ drive , ...rest ] = abs . split ( ':' )
62- return rest . length === 0
63- ? abs
64- : [
65- extensionId === VSCODE_EXTENSION_ID . awstoolkitcore ? drive . toLowerCase ( ) : drive . toUpperCase ( ) ,
66- ...rest ,
67- ] . join ( ':' )
65+ return rest . length === 0 ? abs : [ drive . toUpperCase ( ) , ...rest ] . join ( ':' )
6866 }
6967
7068 const root = getRoot ( )
@@ -115,7 +113,7 @@ export async function runTests(
115113 } )
116114
117115 function runMocha ( files : string [ ] ) : Promise < void > {
118- files . forEach ( ( f ) => mocha . addFile ( path . resolve ( dist , f ) ) )
116+ files . forEach ( ( f ) => mocha . addFile ( path . resolve ( process . cwd ( ) , f ) ) )
119117 return new Promise < void > ( ( resolve , reject ) => {
120118 mocha . run ( ( failures ) => {
121119 if ( failures > 0 ) {
@@ -139,7 +137,8 @@ export async function runTests(
139137 console . log ( 'No test coverage found' )
140138 }
141139 }
142- const files = testFiles ?? ( await glob ( testFilePath ?? `**/${ testFolder } /**/**.test.js` , { cwd : dist } ) )
140+ const files = testFiles ?? ( await glob ( testFilePath ?? `**/${ testFolder } /**/**.test.js` ) )
141+ console . log ( `@@@ files: ${ files } ` )
143142
144143 await runMocha ( files )
145144 await writeCoverage ( )
0 commit comments