@nuxtjs/module-test-utils
Test utilities for modules Nuxt.js
Setup
Add @nuxtjs/module-test-utils
dependency to your project
yarn add --dev @nuxtjs/module-test-utils # or npm install --save-dev @nuxtjs/module-test-utils
Usage
const { setup, loadConfig, get } = require('@nuxtjs/module-test-utils')
describe('basic', () => {
let nuxt
beforeAll(async () => {
({ nuxt } = await setup(loadConfig(__dirname)))
}, 60000)
afterAll(async () => {
await nuxt.close()
})
test('render', async () => {
const html = await get('/')
expect(html).toContain('Works!')
})
})
License
Copyright (c) - Nuxt Community