Skip to content

Commit

Permalink
fix: fix type test collect
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Nov 11, 2024
1 parent 147165a commit d1dda8e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/vitest/src/typecheck/collect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,14 @@ export async function collectTests(
ctx: WorkspaceProject,
filepath: string,
): Promise<null | FileInformation> {
// TODO: can we avoid ssr transform entirely?
// const request = await ctx.server.transformRequest(filepath)
const request = await ctx.vitenode.transformRequest(filepath, filepath)
if (!request) {
return null
}
// unwrap __vite_ssr_identity__ for now
request.code = request.code.replace(/__vite_ssr_identity__\((\w+\.\w+)\)/g, '$1')
const ast = await parseAstAsync(request.code)
const testFilepath = relative(ctx.config.root, filepath)
const projectName = ctx.getName()
Expand Down

0 comments on commit d1dda8e

Please sign in to comment.