Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix(test-utils): handle vitest v0.20
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Sep 21, 2022
1 parent 9c9e20e commit cad8f5a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/test-utils/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,30 @@ export async function runTests (opts: RunTestOptions) {
process.env.NUXT_TEST_DEV = 'true'
}

// TODO: add `as typeof import('vitest/dist/node')` and remove workaround
// when we upgrade vitest: see https://github.com/nuxt/framework/issues/6297

// @ts-ignore missing types
const { startVitest } = await import('vitest/dist/node.mjs')
const succeeded = await startVitest(
const args: any[] = [
[] /* argv */,
// Vitest options
{
root: opts.rootDir,
run: !opts.watch
run: !opts.watch,
deps: {
inline: [/@nuxt\/test-utils/]
}
},
// Vite options
{
esbuild: {
tsconfigRaw: '{}'
}
}
)
]
if (startVitest.length >= 4) { args.unshift('test') }
const succeeded = await startVitest(...args)

if (!succeeded) {
process.exit(1)
Expand Down

0 comments on commit cad8f5a

Please sign in to comment.