Skip to content

Commit 6e18db0

Browse files
committed
chore: remove vitest.moduleGraph
1 parent 986a935 commit 6e18db0

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

packages/vitest/src/node/publicRunner.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { slash } from '../utils'
55
import type { TestModule } from './reporters/reported-tasks'
66
import type { Vitest as VitestCore } from './core'
77
import type { TestSpecification } from './spec'
8-
import type { VitestModuleGraph } from './publicVitest'
98

109
export interface VitestRunner {
1110
// Vitest starts a standalone runner, will react on watch changes, it doesn't run tests
@@ -19,7 +18,7 @@ export interface VitestRunner {
1918
run: () => Promise<TestRunResult>
2019
collect: () => Promise<TestRunResult>
2120
runModules: (moduleNames: string[]) => Promise<TestRunResult>
22-
runTests: (filters: TestSpecification[]) => Promise<TestRunResult>
21+
runTests: (filters: Array<TestSpecification>) => Promise<TestRunResult>
2322
mergeReports: () => Promise<TestRunResult>
2423
}
2524

@@ -34,7 +33,6 @@ export class VitestRunner_ implements VitestRunner {
3433

3534
constructor(
3635
vitest: VitestCore,
37-
private readonly moduleGraph: VitestModuleGraph,
3836
) {
3937
this[kVitest] = vitest
4038
}

packages/vitest/src/node/publicVitest.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable ts/method-signature-style */
2-
import type { ModuleNode, ViteDevServer } from 'vite'
2+
import type { ViteDevServer } from 'vite'
33
import type { SnapshotResult } from '@vitest/snapshot'
44
import type { TestProject } from './reported-test-project'
55
import type { ResolvedConfig } from './types/config'
@@ -17,7 +17,6 @@ export interface Vitest {
1717
readonly config: ResolvedConfig
1818
readonly projects: TestProject[]
1919
readonly vite: ViteDevServer
20-
readonly moduleGraph: VitestModuleGraph
2120
readonly runner: VitestRunner
2221
readonly context: VitestContext
2322
readonly snapshot: VitestSnapshot
@@ -42,11 +41,10 @@ export class _Vitest implements Vitest {
4241
public readonly config: ResolvedConfig,
4342
public readonly projects: TestProject[],
4443
public readonly vite: ViteDevServer,
45-
public readonly moduleGraph: VitestModuleGraph,
4644
public readonly logger: Logger,
4745
) {
4846
this[kVitest] = vitest
49-
this.runner = new VitestRunner_(vitest, moduleGraph)
47+
this.runner = new VitestRunner_(vitest)
5048
this.context = new VitestContext(vitest.getCoreWorkspaceProject())
5149
this.snapshot = new VitestSnapshot(vitest)
5250
}
@@ -64,16 +62,6 @@ export class _Vitest implements Vitest {
6462
}
6563
}
6664

67-
export interface VitestModuleGraph {
68-
getTestModuleIds(moduleNames?: string[]): string[]
69-
getViteModuleNodeById(
70-
transformMode: 'web' | 'ssr' | 'browser',
71-
moduleId: string,
72-
): ModuleNode | undefined
73-
getViteModuleNodesById(moduleId: string): ModuleNode[]
74-
invalidateViteModulesByFile(file: string): void
75-
}
76-
7765
class VitestSnapshot {
7866
private readonly [kVitest]: VitestCore
7967

0 commit comments

Comments
 (0)