From 654ddd412a3ec3aaaa94c9e6072d8afe1f4301b5 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 19 Oct 2022 14:10:51 +0100 Subject: [PATCH] refactor(test-utils)!: update vitest args (#8325) --- packages/test-utils/src/run.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/test-utils/src/run.ts b/packages/test-utils/src/run.ts index 80678aeae5..c17649481f 100644 --- a/packages/test-utils/src/run.ts +++ b/packages/test-utils/src/run.ts @@ -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 { @@ -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)