docs: recommend to install non-edge version of @nuxt/test-utils (#9543)

This commit is contained in:
Daniel Roe 2022-12-06 11:51:17 +00:00 committed by GitHub
parent d0c0cd7ad2
commit 3066e495a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -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({

View File

@ -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({