Skip to content

Commit 2d17cba

Browse files
Fix broken test
If `max` is 1 - Math.epsilon, the result is indistinguishable from 42000, and the tests fail. To fix this, Math.epsilon must be multiplied by more than 16.
1 parent ac1d8da commit 2d17cba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exercises/concept/captains-log/captains-log.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function loadDie(...values) {
3535
describe('randomStardate', () => {
3636
test('stardate is between 41000 and 42000', () => {
3737
const min = 0;
38-
const max = 1 - Number.EPSILON;
38+
const max = 1 - Number.EPSILON * 32;
3939

4040
// prettier-ignore
4141
const restore = loadDie(

0 commit comments

Comments
 (0)