Skip to content

Make some features of nuxt-vitest available in nuxt bridge as well.

License

Notifications You must be signed in to change notification settings

wattanx/nuxt-bridge-vitest

Repository files navigation

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

About

Make some features of nuxt-vitest available in nuxt bridge as well.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages