test: Add tests for all existing functionality, correcting issues (#9)
All checks were successful
/ test (push) Successful in 11s
All checks were successful
/ test (push) Successful in 11s
Resolves #8. Reviewed-on: #9 Co-authored-by: Glen Whitney <glen@studioinfinity.org> Co-committed-by: Glen Whitney <glen@studioinfinity.org>
This commit is contained in:
parent
64f99c0f2d
commit
1a6890f458
12 changed files with 298 additions and 24 deletions
8
src/number/__test__/type.spec.js
Normal file
8
src/number/__test__/type.spec.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
import assert from 'assert'
|
||||
import math from '#nanomath'
|
||||
|
||||
describe('number type operations', () => {
|
||||
it('converts to number', () => {
|
||||
assert.strictEqual(math.number(2.637), 2.637)
|
||||
})
|
||||
})
|
8
src/number/__test__/utils.spec.js
Normal file
8
src/number/__test__/utils.spec.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
import assert from 'assert'
|
||||
import math from '#nanomath'
|
||||
|
||||
describe('number utilities', () => {
|
||||
it('clones a number', () => {
|
||||
assert.strictEqual(math.clone(2.637), 2.637)
|
||||
})
|
||||
})
|
|
@ -1,5 +1,7 @@
|
|||
import {Returns, onType} from '#core/helpers.js'
|
||||
import {Number} from './Number.js'
|
||||
|
||||
import {onType} from '#core/helpers.js'
|
||||
import {Returns} from '#core/Type.js'
|
||||
|
||||
export const plain = f => onType(
|
||||
Array(f.length).fill(Number), Returns(Number, f))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue