Skip to content

Commit

Permalink
test single value with range option
Browse files Browse the repository at this point in the history
Test using Mocha closeTo w/ delta
  • Loading branch information
davidsanner authored Nov 12, 2021
1 parent de7fc56 commit 7b7bf96
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ describe('derived data converts', function () {
let res = calc.calculator.apply(null, test.input)
if (test.expected) {
res.should.jsonEqual(test.expected)
} else if (test.expectedRange) {
res[0].value.should.closeTo(test.expectedRange[0].value, test.expectedRange[0].delta)
} else {
(typeof res).should.equal('undefined')
}
Expand Down

0 comments on commit 7b7bf96

Please sign in to comment.