Skip to content

Commit

Permalink
fix: fixes unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
piscis committed Jun 1, 2024
1 parent 3f866cf commit b9455e6
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 41 deletions.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
"preview": "nuxt preview",
"analyze": "nuxi analyze",
"postinstall": "nuxt prepare",
"test": "nuxi test",
"test:watch": "nuxi test --dev --watch",
"test": "vitest",
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
Expand All @@ -54,8 +53,8 @@
"@vercel/analytics": "^1.3.1",
"cloudflare": "^3.2.0",
"eslint": "^9.4.0",
"happy-dom": "^14.12.0",
"nuxt": "^3.11.2",
"playwright": "^1.44.1",
"radash": "^12.1.0",
"release-it": "^17.3.0",
"sass": "1.77.4",
Expand Down
69 changes: 33 additions & 36 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions tests/base.test.ts → test/base.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { describe, expect, it } from 'vitest'
import { $fetch, fetch, isDev } from '@nuxt/test-utils'
import { $fetch, fetch, isDev, setup } from '@nuxt/test-utils/e2e'

describe('base', async () => {
await setup()

describe('base', () => {
it('index page is callable', async () => {
const doc = await $fetch('/')
expect(doc).toContain('DOCTYPE')
Expand Down
7 changes: 7 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineVitestConfig } from '@nuxt/test-utils/config'

export default defineVitestConfig({
test: {
environment: 'nuxt',
},
})

0 comments on commit b9455e6

Please sign in to comment.