Skip to content

Commit

Permalink
fix: --inspect-brk stop on Windows (#6110)
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio authored Jul 13, 2024
1 parent f44cc91 commit f851982
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/vitest/src/runtime/inspector.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createRequire } from 'node:module'

import { pathToFileURL } from 'node:url'
import type { ContextRPC, ResolvedConfig } from '../types'

const __require = createRequire(import.meta.url)
Expand Down Expand Up @@ -37,7 +37,7 @@ export function setupInspect(ctx: ContextRPC) {
session.post('Debugger.enable')
session.post('Debugger.setBreakpointByUrl', {
lineNumber: 0,
url: new URL(firstTestFile, import.meta.url).href,
url: pathToFileURL(firstTestFile),
})
}
}
Expand Down
3 changes: 1 addition & 2 deletions test/cli/test/inspect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import type { InspectorNotification } from 'node:inspector'
import { expect, test } from 'vitest'
import WebSocket from 'ws'

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

type Message = Partial<InspectorNotification<any>>

test.skipIf(isWindows)('--inspect-brk stops at test file', async () => {
test('--inspect-brk stops at test file', async () => {
const { vitest, waitForClose } = await runVitestCli(
'--root',
'fixtures/inspect',
Expand Down

0 comments on commit f851982

Please sign in to comment.