Skip to content

Commit 322aaee

Browse files
committed
test: Fixed some coverage issues
1 parent 37792b0 commit 322aaee

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

test/clamp-01.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ describe('Clamp value between 0 and 1', () => {
55
expect(clamp01(1)).toBe(1)
66
})
77

8+
it('Expect clamp01 with 2 to be 1', () => {
9+
expect(clamp01(2)).toBe(1)
10+
})
11+
812
it('Expect clamp01 with 0.5 to be 0.5', () => {
913
expect(clamp01(0.5)).toBe(0.5)
1014
})

test/delta-time.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import { deltaTime } from '../src/math-toolbox'
22

33
describe('Calculate delta time', () => {
44
it('Test with default param of Date.now()', () => {
5-
expect(deltaTime(Date.now() - 200)).toBe(200)
5+
expect(deltaTime(Date.now() - 200)).toBeCloseTo(200, 1) // Some time the test is too slow
66
})
77
})

0 commit comments

Comments
 (0)