Skip to content

Commit

Permalink
test: exclude default error pages from bundle test
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Apr 25, 2023
1 parent c657821 commit ba320a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 3 additions & 6 deletions test/bundle.test.ts
Expand Up @@ -34,24 +34,21 @@ describe.skipIf(isWindows || process.env.TEST_BUILDER === 'webpack' || process.e

it('default client bundle size', async () => {
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(`
[
"_nuxt/_plugin-vue_export-helper.js",
"_nuxt/entry.js",
"_nuxt/error-404.js",
"_nuxt/error-500.js",
"_nuxt/error-component.js",
]
`)
})

it('default server bundle size', async () => {
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)
expect(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot('"2657k"')
expect(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot('"2653k"')

const packages = modules.files
.filter(m => m.endsWith('package.json'))
Expand Down
3 changes: 3 additions & 0 deletions test/fixtures/minimal/error.vue
@@ -0,0 +1,3 @@
<template>
<div>Error page</div>
</template>

0 comments on commit ba320a5

Please sign in to comment.