Skip to content

Commit e505eeb

Browse files
committed
Fixes
1 parent c7831bf commit e505eeb

File tree

6 files changed

+9
-6
lines changed

6 files changed

+9
-6
lines changed

packages/runner/src/run.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,8 @@ export async function runFiles(files: File[], runner: VitestRunner): Promise<voi
495495
}
496496
}
497497

498-
export async function startTests(specs: FileSpec[], runner: VitestRunner): Promise<File[]> {
499-
const paths = specs.map(f => f.filepath)
498+
export async function startTests(specs: string[] | FileSpec[], runner: VitestRunner): Promise<File[]> {
499+
const paths = specs.map(f => typeof f === 'string' ? f : f.filepath)
500500
await runner.onBeforeCollect?.(paths)
501501

502502
const files = await collectTests(specs, runner)

packages/vitest/src/node/pools/forks.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { FileSpec } from '@vitest/runner/types/runner'
12
import type { TinypoolChannel, Options as TinypoolOptions } from 'tinypool'
23
import type { RunnerRPC, RuntimeRPC } from '../../types/rpc'
34
import type { ContextRPC, ContextTestEnvironment } from '../../types/worker'

packages/vitest/src/node/pools/vmThreads.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { FileSpec } from '@vitest/runner/types/runner'
12
import type { Options as TinypoolOptions } from 'tinypool'
23
import type { RunnerRPC, RuntimeRPC } from '../../types/rpc'
34
import type { ContextTestEnvironment } from '../../types/worker'

packages/vitest/src/node/spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ export class TestSpecification {
2727
workspaceProject: WorkspaceProject,
2828
moduleId: string,
2929
pool: Pool,
30-
// location?: WorkspaceSpecLocation | undefined,
31-
testLocations: number[] | undefined,
30+
testLocations?: number[] | undefined,
3231
) {
3332
this[0] = workspaceProject
3433
this[1] = moduleId

packages/vitest/src/runtime/inspector.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ export function setupInspect(ctx: ContextRPC) {
2828
)
2929

3030
if (config.inspectBrk) {
31-
const firstTestFile = ctx.files[0]
31+
const firstTestFile = typeof ctx.files[0] === 'string'
32+
? ctx.files[0]
33+
: ctx.files[0].filepath
3234

3335
// Stop at first test file
3436
if (firstTestFile) {

packages/vitest/src/runtime/runBaseTests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export async function run(
6262
resetModules(workerState.moduleCache, true)
6363
}
6464

65-
workerState.filepath = file.file
65+
workerState.filepath = file.filepath
6666

6767
if (method === 'run') {
6868
await startTests([file], runner)

0 commit comments

Comments
 (0)