diff --git a/test/e2e/app-dir/build-size/index.test.ts b/test/e2e/app-dir/build-size/index.test.ts index 527c17afd222c..029307568dd35 100644 --- a/test/e2e/app-dir/build-size/index.test.ts +++ b/test/e2e/app-dir/build-size/index.test.ts @@ -33,13 +33,12 @@ describe('app-dir build size', () => { const index = result['/'] const foo = result['/foo'] - // index route has a page, so it should not be 0 - expect(sizeToBytes(index.size)).toBeGreaterThan(0) expect(sizeToBytes(index.firstLoadJS)).toBeGreaterThan(0) + expect(sizeToBytes(foo.firstLoadJS)).toBeGreaterThan(0) - // foo route has a page, so it should not be 0 + // index route has a page with no client JS, so it could serve zero additional JS (size = 0) + // foo route has a page with client references, so has to serve additional non-shared JS expect(sizeToBytes(foo.size)).toBeGreaterThan(0) - expect(sizeToBytes(foo.firstLoadJS)).toBeGreaterThan(0) // foo is a client component, so it should be larger than index expect(sizeToBytes(foo.size)).toBeGreaterThan(sizeToBytes(index.size))