Skip to content

Commit 28d9949

Browse files
committed
chore: remove unused code
1 parent 16f21fe commit 28d9949

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

packages/vitest/src/api/setup.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,21 +113,11 @@ export function setup(vitestOrWorkspace: Vitest | WorkspaceProject, _server?: Vi
113113
getConfig() {
114114
return vitestOrWorkspace.config
115115
},
116-
async getBrowserFileSourceMap(id, options) {
116+
async getBrowserFileSourceMap(id) {
117117
if (!('ctx' in vitestOrWorkspace))
118118
return undefined
119119
const mod = vitestOrWorkspace.browser?.moduleGraph.getModuleById(id)
120-
if (!mod)
121-
return undefined
122-
123-
const ssr = !!options?.ssr
124-
// should technically only be a single module because we don't load test files with multiple modules
125-
if (ssr && mod.ssrTransformResult)
126-
return mod.ssrTransformResult.map
127-
if (mod.transformResult)
128-
return mod.transformResult.map
129-
130-
return undefined
120+
return mod?.transformResult?.map
131121
},
132122
async getTransformResult(id) {
133123
const result: TransformResultWithSource | null | undefined = await ctx.vitenode.transformRequest(id)

packages/vitest/src/api/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export interface WebSocketHandlers {
2020
resolveSnapshotPath: (testPath: string) => string
2121
resolveSnapshotRawPath: (testPath: string, rawPath: string) => string
2222
getModuleGraph: (id: string) => Promise<ModuleGraphData>
23-
getBrowserFileSourceMap: (id: string, options?: { ssr: boolean }) => Promise<TransformResult['map'] | undefined>
23+
getBrowserFileSourceMap: (id: string) => Promise<TransformResult['map'] | undefined>
2424
getTransformResult: (id: string) => Promise<TransformResultWithSource | undefined>
2525
readSnapshotFile: (id: string) => Promise<string | null>
2626
readTestFile: (id: string) => Promise<string | null>

0 commit comments

Comments
 (0)