Skip to content

Commit b9455e6

Browse files
committed
fix: fixes unit tests
1 parent 3f866cf commit b9455e6

File tree

4 files changed

+46
-41
lines changed

4 files changed

+46
-41
lines changed

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
"preview": "nuxt preview",
3232
"analyze": "nuxi analyze",
3333
"postinstall": "nuxt prepare",
34-
"test": "nuxi test",
35-
"test:watch": "nuxi test --dev --watch",
34+
"test": "vitest",
3635
"lint": "eslint .",
3736
"lint:fix": "eslint . --fix"
3837
},
@@ -54,8 +53,8 @@
5453
"@vercel/analytics": "^1.3.1",
5554
"cloudflare": "^3.2.0",
5655
"eslint": "^9.4.0",
56+
"happy-dom": "^14.12.0",
5757
"nuxt": "^3.11.2",
58-
"playwright": "^1.44.1",
5958
"radash": "^12.1.0",
6059
"release-it": "^17.3.0",
6160
"sass": "1.77.4",

pnpm-lock.yaml

+33-36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/base.test.ts test/base.spec.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { describe, expect, it } from 'vitest'
2-
import { $fetch, fetch, isDev } from '@nuxt/test-utils'
2+
import { $fetch, fetch, isDev, setup } from '@nuxt/test-utils/e2e'
3+
4+
describe('base', async () => {
5+
await setup()
36

4-
describe('base', () => {
57
it('index page is callable', async () => {
68
const doc = await $fetch('/')
79
expect(doc).toContain('DOCTYPE')

vitest.config.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineVitestConfig } from '@nuxt/test-utils/config'
2+
3+
export default defineVitestConfig({
4+
test: {
5+
environment: 'nuxt',
6+
},
7+
})

0 commit comments

Comments
 (0)