Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing method types for moduleContainer #120

Merged
merged 4 commits into from
May 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/content/en/api-reference/module-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ When you write tests for a Nuxt module, you normally expect the module to be ins
* `method`
* Type: `String`
* `required`
* Available values are `addPlugin`, `addLayout`, `addErrorLayout`, `addServerMiddleware` and `requireModule`
* Available values are `addTemplate`, `extendBuild`, `extendRoutes`, `addModule`, `addPlugin`, `addLayout`, `addErrorLayout`, `addServerMiddleware` and `requireModule`
* `args`
* `optional`
* Additional parameters that are expected to be passed to the tested `method`
Expand All @@ -38,7 +38,7 @@ test('should inject plugin', () => {
* `method`
* Type: `String`
* `required`
* Available values are `addPlugin`, `addLayout`, `addErrorLayout`, `addServerMiddleware` and `requireModule`
* Available values are `addTemplate`, `extendBuild`, `extendRoutes`, `addModule`, `addPlugin`, `addLayout`, `addErrorLayout`, `addServerMiddleware` and `requireModule`
* `args`
* `optional`
* Additional parameters that are expected to be passed to the tested `method`
Expand Down
2 changes: 1 addition & 1 deletion src/assertions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { existsSync } from 'fs'
import { resolve } from 'path'
import { getNuxt } from './nuxt'

type ModuleContainerMethod = 'addPlugin' | 'addLayout' | 'addErrorLayout' | 'addServerMiddleware' | 'requireModule'
type ModuleContainerMethod = 'addTemplate' | 'extendBuild' | 'extendRoutes' | 'addModule' | 'addPlugin' | 'addLayout' | 'addErrorLayout' | 'addServerMiddleware' | 'requireModule'

export function expectModuleToBeCalledWith (method: ModuleContainerMethod, ...args: any[]) {
expect(getNuxt().moduleContainer[method]).toBeCalledWith(...args)
Expand Down