chore: use @nuxt/test-utils to import test utils (#3261)

This commit is contained in:
Anthony Fu 2022-02-17 02:07:33 +08:00 committed by GitHub
parent 289d54eb24
commit 16c2b6113a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -1,14 +1,12 @@
import { fileURLToPath } from 'url'
import { resolve } from 'path'
import { describe, expect, it } from 'vitest'
// TODO: Should import from @nuxt/test-utils
import { setup, $fetch } from '../../packages/test-utils/src'
import { setup, $fetch } from '@nuxt/test-utils'
const examplesDir = fileURLToPath(new URL('../../examples', import.meta.url))
await setup({
rootDir: resolve(examplesDir, 'hello-world'),
runner: 'vitest',
server: true
})

8
vitest.config.ts Normal file
View File

@ -0,0 +1,8 @@
import { resolve } from 'path'
import { defineConfig } from 'vite'
export default defineConfig({
alias: {
'@nuxt/test-utils': resolve('./packages/test-utils/src/index.ts')
}
})