Skip to content

Commit f851982

Browse files
authoredJul 13, 2024··
fix: --inspect-brk stop on Windows (#6110)
1 parent f44cc91 commit f851982

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed
 

‎packages/vitest/src/runtime/inspector.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createRequire } from 'node:module'
2-
2+
import { pathToFileURL } from 'node:url'
33
import type { ContextRPC, ResolvedConfig } from '../types'
44

55
const __require = createRequire(import.meta.url)
@@ -37,7 +37,7 @@ export function setupInspect(ctx: ContextRPC) {
3737
session.post('Debugger.enable')
3838
session.post('Debugger.setBreakpointByUrl', {
3939
lineNumber: 0,
40-
url: new URL(firstTestFile, import.meta.url).href,
40+
url: pathToFileURL(firstTestFile),
4141
})
4242
}
4343
}

‎test/cli/test/inspect.test.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ import type { InspectorNotification } from 'node:inspector'
22
import { expect, test } from 'vitest'
33
import WebSocket from 'ws'
44

5-
import { isWindows } from '../../../packages/vite-node/src/utils'
65
import { runVitestCli } from '../../test-utils'
76

87
type Message = Partial<InspectorNotification<any>>
98

10-
test.skipIf(isWindows)('--inspect-brk stops at test file', async () => {
9+
test('--inspect-brk stops at test file', async () => {
1110
const { vitest, waitForClose } = await runVitestCli(
1211
'--root',
1312
'fixtures/inspect',

0 commit comments

Comments
 (0)
Please sign in to comment.