mathjs/test/unit-tests/core/config.test.js
Chris Chudzicki 13a3d4c198
Linting: StandardJS for src/, test/; Prettier for types/ (#2544)
* setup linting with eslint-config-standard, prettier

* [autofix] npm run lint -- --fix with new setup

* [manual] fix types/ directory errors

* [manual] fix linting errors in test/ directory

* [manual] fix single linting error in src/

* revert ts-expect-error comment change

* error on .only in mocha tests

* fix test description typo

* move some short objects to single line

* add and gitignore eslintcache

* individually suppress ts any

* set --max-warnings to 0

* extract matrices to constants

* update ts-expect-error comments
2022-04-29 12:04:01 +02:00

21 lines
548 B
JavaScript

import assert from 'assert'
import math from '../../../src/defaultInstance.js'
describe('config', function () {
it('should allow setting config after having overwritten import', function () {
const math2 = math.create()
assert.strictEqual(math2.typeOf(math2.pi), 'number')
math2.import({
import: () => { throw new Error('Function import is disabled') }
}, { override: true })
math2.config({ number: 'BigNumber' })
assert.strictEqual(math2.typeOf(math2.pi), 'BigNumber')
})
// TODO: test function config
})