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

Commit

Permalink
refactor(test-utils)!: update vitest args (#8325)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Oct 19, 2022
1 parent d82d145 commit 654ddd4
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/test-utils/src/run.ts
Expand Up @@ -21,12 +21,10 @@ 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 args: any[] = [
const { startVitest } = await import('vitest/dist/node.mjs') as typeof import('vitest/dist/node')
const succeeded = await startVitest(
'test',
[] /* argv */,
// Vitest options
{
Expand All @@ -42,9 +40,7 @@ export async function runTests (opts: RunTestOptions) {
tsconfigRaw: '{}'
}
}
]
if (startVitest.length >= 4) { args.unshift('test') }
const succeeded = await startVitest(...args)
)

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

0 comments on commit 654ddd4

Please sign in to comment.