Installation

How to install the Nuxt test utilities

Installation

Add @nuxt/test-utils to your project (as a development dependency):

yarn add --dev jest @nuxt/test-utils
npm install --save-dev jest @nuxt/test-utils

@nuxt/test-utils depends on Jest.

Configure Jest

Add @nuxt/test-utils to the preset section of jest.config.js

jest.config.js
module.exports = {
  preset: '@nuxt/test-utils'
}