Skip to content

Latest commit

 

History

History
40 lines (25 loc) · 948 Bytes

README.md

File metadata and controls

40 lines (25 loc) · 948 Bytes

nuxt bridge vitest

Warning

This library is in active development and you should pin the patch version before using.

Supporting nuxt bridge testing in the vitest environment.

▶️ Playground

Installation

  1. 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
  1. 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
});

Helpers

Currently only mockNuxtImport is supported.

mockNuxtImport

The basic usage is the same as @nuxt/test-utils.

https://nuxt.com/docs/getting-started/testing#mocknuxtimport