All checks were successful
/ test (pull_request) Successful in 17s
Refactors each TypeDispatcher to have its own separate collection of types. Add isnan function which returns a boolean if that type is present, otherwise returns the number 1 for true, and 0 for fase.
13 lines
424 B
JavaScript
13 lines
424 B
JavaScript
import assert from 'assert'
|
|
import math from '../numbers.js'
|
|
|
|
describe('the numbers-only bundle', () => {
|
|
it('works like regular on number-only functions', () => {
|
|
assert.strictEqual(math.quotient(5, 3), 1)
|
|
assert.strictEqual(math.square(-3), 9)
|
|
})
|
|
it('uses 1 and 0 instead of true and false', () => {
|
|
assert.strictEqual(math.isnan(-16.5), 0)
|
|
assert.strictEqual(math.isnan(NaN), 1)
|
|
})
|
|
})
|