Skip to content

Commit bd74d2f

Browse files
authored
test: fix "Extension Tests (current file)" task on Windows #1057
Handle backslashes.
1 parent 2f6ac1c commit bd74d2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

third-party/test/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function run(testsRoot, clb): any {
122122
// 2020-03-24: Amazon addition.
123123
// VSCode refuses to unset this value, so it gets set for each task and null is converted to a string
124124
const testFile = process.env["TEST_FILE"] === 'null' ? undefined : process.env["TEST_FILE"]
125-
const testFilePath = testFile?.replace(/^src\/test\//, "")?.concat('.js')
125+
const testFilePath = testFile?.replace(/^src[\\\/]test[\\\/]/, '')?.concat('.js')
126126

127127
const globalSetupPath = paths.join(testsRoot, 'globalSetup.test.js')
128128
if (testFilePath && fs.existsSync(globalSetupPath)) {

0 commit comments

Comments
 (0)