We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 147165a commit d1dda8eCopy full SHA for d1dda8e
packages/vitest/src/typecheck/collect.ts
@@ -47,10 +47,14 @@ export async function collectTests(
47
ctx: WorkspaceProject,
48
filepath: string,
49
): Promise<null | FileInformation> {
50
+ // TODO: can we avoid ssr transform entirely?
51
+ // const request = await ctx.server.transformRequest(filepath)
52
const request = await ctx.vitenode.transformRequest(filepath, filepath)
53
if (!request) {
54
return null
55
}
56
+ // unwrap __vite_ssr_identity__ for now
57
+ request.code = request.code.replace(/__vite_ssr_identity__\((\w+\.\w+)\)/g, '$1')
58
const ast = await parseAstAsync(request.code)
59
const testFilepath = relative(ctx.config.root, filepath)
60
const projectName = ctx.getName()
0 commit comments