Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/worker/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export async function initVitest(
project: meta.projectFilter ?? args.project,
watch: true,
api: false,
// @ts-expect-error private property
reporter: undefined,
ui: false,
includeTaskLocation: true,
Expand Down
11 changes: 9 additions & 2 deletions packages/worker/src/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {
VitestWorkerRPC,
WorkerWSEventEmitter,
} from 'vitest-vscode-shared'
import type { TestSpecification, Vitest as VitestCore } from 'vitest/node'
import type { TestModule, TestSpecification, Vitest as VitestCore } from 'vitest/node'

export class ExtensionWorkerRunner {
private rpc!: VitestWorkerRPC
Expand Down Expand Up @@ -43,14 +43,21 @@ export class ExtensionWorkerRunner {
}

public async collectSpecifications(specifications: TestSpecification[]): Promise<void> {
const testModules = await this.vitest.experimental_parseSpecifications(specifications)
const testModules = await this.parseSpecifications(specifications)
const promises = testModules.map((module) =>
// TODO: fix "as any"
this.rpc.onCollected((module as any).task, true),
)
await Promise.all(promises)
}

private parseSpecifications(specifications: TestSpecification[]): Promise<TestModule[]> {
if (this.vitest.parseSpecifications) {
return this.vitest.parseSpecifications(specifications)
}
return this.vitest.experimental_parseSpecifications(specifications)
}

initRpc(rpc: VitestWorkerRPC) {
this.rpc = rpc
}
Expand Down
Loading
Loading