Skip to content

Commit

Permalink
chore: use @nuxt/test-utils to import test utils (nuxt#3261)
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu authored Feb 16, 2022
1 parent 289d54e commit 16c2b61
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 1 addition & 3 deletions test/examples/hello-world.test.ts
Original file line number Diff line number Diff line change
@@ -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
})

Expand Down
8 changes: 8 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -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')
}
})

0 comments on commit 16c2b61

Please sign in to comment.