Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@nuxtjs/module-test-utils

nuxt-community3.2kMITdeprecated1.6.3TypeScript support: included

please use @nuxt/test-utils. https://test-utils.nuxtjs.org/

Test utilities for modules Nuxt.js

readme

@nuxtjs/module-test-utils

npm version npm downloads Circle CI Codecov License

Test utilities for modules Nuxt.js

📖 Release Notes

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

MIT License

Copyright (c) - Nuxt Community

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

1.6.3 (2020-07-01)

Bug Fixes

  • types: correct types of get method options (#22) (f80d07a)

1.6.2 (2020-06-30)

Bug Fixes

  • types: include types in published package (#20) (511a9fe)

1.6.1 (2020-03-17)

Bug Fixes

  • use request-promise-native (982e562)

1.6.0 (2020-03-16)

Features

  • add types for typescript support (2f42426)

1.5.0 (2019-10-29)

Features

1.4.0 (2019-10-23)

Features

  • add option beforeNuxtReady (8ed04e7)

1.3.1 (2019-10-15)

Bug Fixes

  • don't allow mutating original config object by the caller (#5) (642cd1b)

1.3.0 (2019-08-26)

Features

  • allow merging config overrides in loadConfig (#2) (ad61aef), closes #1

1.2.0 (2019-08-20)

Bug Fixes

  • pass options as second paramter (b3386ed)

Features

  • add init helper (0472396)
  • add option override to loadConfig (778cb07)

1.1.0 (2019-08-20)

Bug Fixes

Features

1.0.0 (2019-08-08)

Features

  • add options parameter on get function (bf6dd20)

0.0.1 (2019-07-31)

Features

  • inject builder and generator (6818cce)