chore: update tests

This commit is contained in:
Pooya Parsa 2020-11-30 23:54:30 +01:00
parent c15fc421ab
commit 3b19e3f4b8
2 changed files with 6 additions and 6 deletions

View File

@ -13,16 +13,16 @@ exports[`cli/command builds help text 1`] = `
--spa, -s Launch in SPA mode --spa, -s Launch in SPA mode
--universal, -u Launch in Universal --universal, -u Launch in Universal
mode (default) mode (default)
--config-file, -c Path to Nuxt --config-file, -c Path to Nuxt config
config file (default: nuxt.config) file (default: nuxt.config)
--modern, -m Build/Start app for --modern, -m Build/Start app for
modern browsers, e.g. server, client and modern browsers, e.g. server, client and
false false
--target, -t Build/start app for a --target, -t Build/start app for a
different target, e.g. server, different target, e.g. server,
serverless and static serverless and static
--force-exit Whether Nuxt --force-exit Whether Nuxt should
should force exit after the command has force exit after the command has
finished finished
--version, -v Display the Nuxt --version, -v Display the Nuxt
version version

View File

@ -197,7 +197,7 @@ describe('server: nuxtMiddleware', () => {
await nuxtMiddleware(req, res, next) await nuxtMiddleware(req, res, next)
expect(res.setHeader).nthCalledWith(1, 'Link', '</nuxt/nuxt.js/preload1.js>; rel=preload; as=script, </nuxt/nuxt.js/preload2.js>; rel=preload; as=script, </nuxt/nuxt.js/style.css>; rel=preload; as=style') expect(res.setHeader).nthCalledWith(1, 'Link', '</nuxt/nuxt/preload1.js>; rel=preload; as=script, </nuxt/nuxt/preload2.js>; rel=preload; as=script, </nuxt/nuxt/style.css>; rel=preload; as=style')
}) })
test('should ignore preload files which are excluded by shouldPush', async () => { test('should ignore preload files which are excluded by shouldPush', async () => {
@ -228,7 +228,7 @@ describe('server: nuxtMiddleware', () => {
expect(consola.warn).toBeCalledWith('http2.shouldPush is deprecated. Use http2.pushAssets function') expect(consola.warn).toBeCalledWith('http2.shouldPush is deprecated. Use http2.pushAssets function')
expect(context.options.render.http2.shouldPush).toBeCalledTimes(4) expect(context.options.render.http2.shouldPush).toBeCalledTimes(4)
expect(res.setHeader).nthCalledWith(1, 'Link', '</nuxt/nuxt.js/preload1.js>; rel=preload; crossorigin=use-credentials; as=script, </nuxt/nuxt.js/preload2.js>; rel=modulepreload; crossorigin=use-credentials; as=script') expect(res.setHeader).nthCalledWith(1, 'Link', '</nuxt/nuxt/preload1.js>; rel=preload; crossorigin=use-credentials; as=script, </nuxt/nuxt/preload2.js>; rel=modulepreload; crossorigin=use-credentials; as=script')
}) })
test('should add csp header if csp is enabled', async () => { test('should add csp header if csp is enabled', async () => {