Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Jun 24, 2021
1 parent 0584319 commit 869f3bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions test/integration/build-output/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,18 @@ describe('Build Output', () => {
gz ? 0.251 : 0.394,
2
)
expect(indexSize.endsWith('B')).toBe(true)
expect(indexSize.endsWith(' B')).toBe(true)

expect(parseFloat(indexFirstLoad)).toBeCloseTo(gz ? 64 : 196, 1)
expect(parseFloat(indexFirstLoad)).toBeCloseTo(gz ? 66.4 : 205, 1)
expect(indexFirstLoad.endsWith('kB')).toBe(true)

expect(parseFloat(err404Size)).toBeCloseTo(gz ? 3.17 : 8.51, 1)
expect(err404Size.endsWith('kB')).toBe(true)
expect(parseFloat(err404Size)).toBeCloseTo(gz ? 195 : 267, 1)
expect(err404Size.endsWith(' B')).toBe(true)

expect(parseFloat(err404FirstLoad)).toBeCloseTo(gz ? 66.9 : 205, 1)
expect(parseFloat(err404FirstLoad)).toBeCloseTo(gz ? 66.3 : 205, 1)
expect(err404FirstLoad.endsWith('kB')).toBe(true)

expect(parseFloat(sharedByAll)).toBeCloseTo(gz ? 63.7 : 196, 1)
expect(parseFloat(sharedByAll)).toBeCloseTo(gz ? 66.1 : 205, 1)
expect(sharedByAll.endsWith('kB')).toBe(true)

const appSizeValue = _appSize.endsWith('kB')
Expand All @@ -149,7 +149,7 @@ describe('Build Output', () => {
true
)

expect(parseFloat(mainSize)).toBeCloseTo(gz ? 20.1 : 62.7, 1)
expect(parseFloat(mainSize)).toBeCloseTo(gz ? 22.5 : 71.2, 1)
expect(mainSize.endsWith('kB')).toBe(true)

expect(parseFloat(frameworkSize)).toBeCloseTo(gz ? 42.0 : 130, 1)
Expand Down
2 changes: 1 addition & 1 deletion test/integration/size-limit/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ describe('Production response size', () => {
const delta = responseSizesBytes / 1024

// Expected difference: < 0.5
expect(delta).toBeCloseTo(286.8, 0)
expect(delta).toBeCloseTo(294.6, 0)
})
})

0 comments on commit 869f3bb

Please sign in to comment.