Skip to content

Commit

Permalink
Better float equal
Browse files Browse the repository at this point in the history
  • Loading branch information
tfloxolodeiro committed Oct 6, 2022
1 parent 31e2645 commit 3e128b9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/unit/services/expects-scoring-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ module('Unit | Service | expects-scoring', function (hooks) {
assert.propEqual(results, [solutionPassMock, e2, e3])
})

const assertFloatEqual = (assert, n1, n2) => { assert.equal(Math.floor(n1), Math.floor(n2)) }
const assertFloatEqual = (assert, n1, n2) => {
const round = (num) => Number((num).toFixed(3))
assert.equal(round(n1), round(n2))
}

test('Total score when using all expects of configuration', function (assert) {
const e1 = expectation(doSomethingId, true)
Expand Down

0 comments on commit 3e128b9

Please sign in to comment.