Warning
This library is in active development and you should pin the patch version before using.
Supporting nuxt bridge testing in the vitest environment.
- First install nuxt-vitest:
pnpm add -D @wattanx/nuxt-bridge-vitest vitest happy-dom
# or
yarn add --dev @wattanx/nuxt-bridge-vitest vitest happy-dom
npm i -D @wattanx/nuxt-bridge-vitest vitest happy-dom
- Then create a
vitest.config.ts
with the following content:
import { defineVitestConfig } from "@wattanx/nuxt-bridge-vitest/config";
export default defineVitestConfig({
// any custom vitest config you require
});
Currently only mockNuxtImport
is supported.
The basic usage is the same as @nuxt/test-utils.
https://nuxt.com/docs/getting-started/testing#mocknuxtimport