mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-19 01:45:53 +00:00
docs: recommend to install non-edge version of @nuxt/test-utils
(#9543)
This commit is contained in:
parent
d0c0cd7ad2
commit
3066e495a0
@ -11,12 +11,12 @@ Test utils are still in development and the API and behavior may change. Current
|
|||||||
If you are a module author, you can find more specific informations in the [Module Author's guide](/docs/guide/going-further/modules#testing)
|
If you are a module author, you can find more specific informations in the [Module Author's guide](/docs/guide/going-further/modules#testing)
|
||||||
::
|
::
|
||||||
|
|
||||||
In Nuxt 3, we have a rewritten version of `@nuxt/test-utils` available as `@nuxt/test-utils-edge`. We support [Vitest](https://github.com/vitest-dev/vitest) and [Jest](https://jestjs.io/) as the test runner.
|
In Nuxt 3, we have a rewritten version of `@nuxt/test-utils`. We support [Vitest](https://github.com/vitest-dev/vitest) and [Jest](https://jestjs.io/) as test runners.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn add --dev @nuxt/test-utils-edge vitest
|
yarn add --dev @nuxt/test-utils vitest
|
||||||
```
|
```
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
@ -25,7 +25,7 @@ In each `describe` block where you are taking advantage of the `@nuxt/test-utils
|
|||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { describe, test } from 'vitest'
|
import { describe, test } from 'vitest'
|
||||||
import { setup, $fetch } from '@nuxt/test-utils-edge'
|
import { setup, $fetch } from '@nuxt/test-utils'
|
||||||
|
|
||||||
describe('My test', async () => {
|
describe('My test', async () => {
|
||||||
await setup({
|
await setup({
|
||||||
|
@ -209,7 +209,7 @@ We can create a test file and use the `rootDir` to test the fixture.
|
|||||||
// basic.test.js
|
// basic.test.js
|
||||||
import { describe, it, expect } from 'vitest'
|
import { describe, it, expect } from 'vitest'
|
||||||
import { fileURLToPath } from 'node:url'
|
import { fileURLToPath } from 'node:url'
|
||||||
import { setup, $fetch } from '@nuxt/test-utils-edge'
|
import { setup, $fetch } from '@nuxt/test-utils'
|
||||||
|
|
||||||
describe('ssr', async () => {
|
describe('ssr', async () => {
|
||||||
await setup({
|
await setup({
|
||||||
|
Loading…
Reference in New Issue
Block a user