Skip to content

Commit

Permalink
Relax test assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Dec 18, 2024
1 parent 03ca32c commit 2bc6c7c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/e2e/app-dir/build-size/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 2bc6c7c

Please sign in to comment.