Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Nov 27, 2024
1 parent bcd0624 commit 0ae4959
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/vitest/src/typecheck/collect.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { File, Suite, Test } from '@vitest/runner'
import type { Node } from 'estree'
import type { RawSourceMap } from 'vite-node'
import type { TestProject } from '../node/project'
import {
Expand All @@ -10,7 +11,6 @@ import {
import { ancestor as walkAst } from 'acorn-walk'
import { relative } from 'pathe'
import { parseAstAsync } from 'vite'
import type { Node } from "estree"

interface ParsedFile extends File {
start: number
Expand Down Expand Up @@ -85,7 +85,7 @@ export async function collectTests(
return getName(callee.tag)
}
if (callee.type === 'MemberExpression') {
const object = callee.object as any;
const object = callee.object as any
// direct call as `__vite_ssr_exports_0__.test()`
if (object?.name?.startsWith('__vite_ssr_')) {
return getName(callee.property)
Expand All @@ -94,10 +94,10 @@ export async function collectTests(
return getName(object?.property)
}
// unwrap (0, ...)
if (callee.type === "SequenceExpression" && callee.expressions.length === 2) {
const [e0, e1] = callee.expressions;
if (e0.type === "Literal" && e0.value === 0) {
return getName(e1);
if (callee.type === 'SequenceExpression' && callee.expressions.length === 2) {
const [e0, e1] = callee.expressions
if (e0.type === 'Literal' && e0.value === 0) {
return getName(e1)
}
}
return null
Expand Down

0 comments on commit 0ae4959

Please sign in to comment.