nanomath/src/__test__/numbers.spec.js
Glen Whitney b2b41d6348
All checks were successful
/ test (pull_request) Successful in 17s
feat: factories can depend on the presence of types
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.
2025-04-13 01:35:10 -07:00

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)
})
})