mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-18 14:59:29 +00:00
33 lines
1006 B
JavaScript
33 lines
1006 B
JavaScript
import assert from 'assert'
|
|
import { add, matrix, isObject, isMatrix, pi, speedOfLight, sqrt } from '../src/mainFull'
|
|
|
|
describe('mainFull', function () {
|
|
it('should export functions', () => {
|
|
assert.strictEqual(add(2, 3), 5)
|
|
assert.strictEqual(sqrt(4), 2)
|
|
})
|
|
|
|
it('should export constants', () => {
|
|
assert.strictEqual(pi, Math.PI)
|
|
})
|
|
|
|
it('should export physical constants', () => {
|
|
assert.strictEqual(speedOfLight.toString(), '2.99792458e+8 m / s')
|
|
})
|
|
|
|
it('should export type checking functions', () => {
|
|
assert.strictEqual(isObject({}), true)
|
|
assert.strictEqual(isObject(null), false)
|
|
assert.strictEqual(isMatrix([]), false)
|
|
assert.strictEqual(isMatrix(matrix()), true)
|
|
})
|
|
|
|
// TODO: test export of create and core
|
|
// TODO: test export of errors
|
|
// TODO: test export json reviver
|
|
// TODO: test export of classes
|
|
// TODO: test export of evaluate and parse
|
|
// TODO: test export of default instance
|
|
// TODO: test snapshot of all exported things
|
|
})
|