test: exclude default error pages from bundle test

This commit is contained in:
Daniel Roe 2023-04-25 10:20:11 +01:00
parent c6578219fa
commit ba320a5589
2 changed files with 6 additions and 6 deletions

View File

@ -34,13 +34,10 @@ describe.skipIf(isWindows || process.env.TEST_BUILDER === 'webpack' || process.e
it('default client bundle size', async () => { it('default client bundle size', async () => {
stats.client = await analyzeSizes('**/*.js', publicDir) stats.client = await analyzeSizes('**/*.js', publicDir)
expect(roundToKilobytes(stats.client.totalBytes)).toMatchInlineSnapshot('"105k"') expect(roundToKilobytes(stats.client.totalBytes)).toMatchInlineSnapshot('"94.0k"')
expect(stats.client.files.map(f => f.replace(/\..*\.js/, '.js'))).toMatchInlineSnapshot(` expect(stats.client.files.map(f => f.replace(/\..*\.js/, '.js'))).toMatchInlineSnapshot(`
[ [
"_nuxt/_plugin-vue_export-helper.js",
"_nuxt/entry.js", "_nuxt/entry.js",
"_nuxt/error-404.js",
"_nuxt/error-500.js",
"_nuxt/error-component.js", "_nuxt/error-component.js",
] ]
`) `)
@ -48,10 +45,10 @@ describe.skipIf(isWindows || process.env.TEST_BUILDER === 'webpack' || process.e
it('default server bundle size', async () => { it('default server bundle size', async () => {
stats.server = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir) stats.server = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir)
expect(roundToKilobytes(stats.server.totalBytes)).toMatchInlineSnapshot('"92.4k"') expect(roundToKilobytes(stats.server.totalBytes)).toMatchInlineSnapshot('"67.2k"')
const modules = await analyzeSizes('node_modules/**/*', serverDir) const modules = await analyzeSizes('node_modules/**/*', serverDir)
expect(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot('"2657k"') expect(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot('"2653k"')
const packages = modules.files const packages = modules.files
.filter(m => m.endsWith('package.json')) .filter(m => m.endsWith('package.json'))

3
test/fixtures/minimal/error.vue vendored Normal file
View File

@ -0,0 +1,3 @@
<template>
<div>Error page</div>
</template>