mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-04 19:37:18 +00:00
a82f8d8b1f
* feat(generator): shared payload support for `nuxt export` * feat: add `export:` hooks for upward compatibility * fix: use setPayload to avoid breaking usage * test: update test * fix: deep assign * chore: update tests * fix: route payload has more periority than shared one * test: update generator hook tests * lint: remove unnecessary import
21 lines
527 B
JavaScript
21 lines
527 B
JavaScript
export const createNuxt = () => ({
|
|
ready: jest.fn(),
|
|
callHook: jest.fn(),
|
|
server: {
|
|
renderRoute: jest.fn(() => ({ html: 'rendered html' }))
|
|
},
|
|
options: {
|
|
mode: 'universal',
|
|
srcDir: '/var/nuxt/src',
|
|
buildDir: '/var/nuxt/build',
|
|
generate: { dir: '/var/nuxt/generate' },
|
|
build: { publicPath: '__public' },
|
|
dir: { static: '/var/nuxt/static' },
|
|
render: {}
|
|
}
|
|
})
|
|
|
|
export function hookCalls (nuxt, name) {
|
|
return nuxt.callHook.mock.calls.filter(c => c[0] === name).map(c => c.splice(1))
|
|
}
|