Skip to content

Commit 3252a77

Browse files
committed
fix: reporter path for windows platform
1 parent f77ed90 commit 3252a77

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

packages/vscode-wdio-worker/src/config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import * as t from '@babel/types'
77
import recast from 'recast'
88

99
const reporterIdentifierName = 'VscodeJsonReporter'
10-
const VSCODE_REPORTER_PATH = path.resolve(__dirname, 'reporter.cjs')
10+
11+
// This file is bundle as parser/ats.js at the package of vscode-webdriverio
12+
// So, the correct reporter path is parent directory
13+
const VSCODE_REPORTER_PATH = path.resolve(__dirname, '../reporter.cjs')
1114
/**
1215
* Since Windows cannot import by reporter file path due to issues with
1316
* the `initializePlugin` method of wdio-utils, the policy is to create a temporary configuration file.

packages/vscode-wdio-worker/tests/config.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ vi.mock('node:path', async (importOriginal) => {
2626
return {
2727
default: {
2828
...actual,
29-
resolve: vi.fn((_, f) => `/path/to/${f}`),
29+
resolve: vi.fn((_, f) => actual.resolve(`/path/to/parser/${f}`)),
3030
},
3131
}
3232
})
3333

3434
describe('config.ts', () => {
35-
const VSCODE_REPORTER_PATH = path.resolve(__dirname, 'reporter.cjs')
35+
const VSCODE_REPORTER_PATH = path.resolve(__dirname, '../reporter.cjs')
3636
const reporterPathUrl = pathToFileURL(VSCODE_REPORTER_PATH).href
3737

3838
beforeEach(() => {

0 commit comments

Comments
 (0)