Nuxt/packages/builder/test/__utils__/index.js
Sébastien Chopin 03eb049677
fix(builder): watch store dir and serverMiddleware paths (#5681)
* fix(builder): Watch store dir to restart Nuxt app when options.store=false

* hotfix: Linting issues

* hotfix: Use path.resolve instead of path.join

* test: Update test for watcher

* hotfix: revert to path.join and fix tests

* hotfix: Fix coverage for hard to test condition

* hotfix: Fix test for Windows

* Update builder.js

* fix lint error

* fix: Cache serverMiddlewarePaths
2019-05-10 15:03:07 +02:00

17 lines
397 B
JavaScript

export const createNuxt = () => ({
options: {
globalName: 'global_name',
globals: [],
build: {},
router: {}
},
ready: jest.fn(),
hook: jest.fn(),
callHook: jest.fn(),
resolver: {
requireModule: jest.fn(() => ({ template: 'builder-template' })),
resolveAlias: jest.fn(src => `resolveAlias(${src})`),
resolvePath: jest.fn(src => `resolvePath(${src})`)
}
})