Configure default timeout for mocha tests as 10 seconds

This commit is contained in:
Jos de Jong 2021-02-03 17:58:37 +01:00
parent 6a6daa6704
commit f812e66252
7 changed files with 4 additions and 14 deletions

View File

@ -122,13 +122,13 @@
"lint": "standard --env=mocha --env=worker",
"validate:ascii": "gulp --gulpfile gulpfile.cjs validate:ascii",
"test": "npm run test:src && npm run lint",
"test:src": "mocha test/unit-tests --recursive --forbid-only",
"test:generated": "mocha test/generated-code-tests --recursive --forbid-only",
"test:node": "mocha test/node-tests/*.test.js test/node-tests/**/*.test.js --recursive --forbid-only",
"test:src": "mocha test/unit-tests --recursive --forbid-only --timeout 10000",
"test:generated": "mocha test/generated-code-tests --recursive --forbid-only --timeout 10000",
"test:node": "mocha test/node-tests/*.test.js test/node-tests/**/*.test.js --recursive --forbid-only --timeout 10000",
"test:all": "npm run test:src && npm run test:generated && npm run test:node",
"test:browser": "karma start test/browser-test-config/local-karma.js",
"test:browserstack": "karma start test/browser-test-config/browserstack-karma.js",
"coverage": "nyc --reporter=lcov --reporter=text-summary mocha test/unit-tests --recursive && echo \"\nDetailed coverage report is available at ./coverage/lcov-report/index.html\"",
"coverage": "nyc --reporter=lcov --reporter=text-summary mocha test/unit-tests --recursive --forbid-only --timeout 10000 && echo \"\nDetailed coverage report is available at ./coverage/lcov-report/index.html\"",
"prepublishOnly": "npm run test:all && npm run lint",
"prepare": "npm run build",
"update-authors": "node ./tools/update-authors.js"

View File

@ -4,8 +4,6 @@ const cp = require('child_process')
const path = require('path')
describe('lib/esm', function () {
this.timeout(10000)
it('should load via mjs', function (done) {
const filename = path.join(__dirname, 'esmApp.mjs')
cp.exec('node ' + filename, function (error, result) {

View File

@ -32,7 +32,6 @@ describe('help', function () {
})
it('should throw an error when constructed without new operator', function () {
this.timeout(10000)
assert.throws(function () {
console.log(Help(embeddedDocs.sin))
}, /Constructor must be called with the new operator/)

View File

@ -34,8 +34,6 @@ function objToStrings (obj) {
/// ////////////////// rationalize ///////////////////////
describe('rationalize', function () {
this.timeout(10000) // For IE/Edge
it('invalid expression', function () {
assert.throws(function () { math.rationalize('(x*/2)') }, /Value expected \(char 4\)/)
})

View File

@ -174,7 +174,6 @@ describe('simplify', function () {
})
it('should preserve the value of BigNumbers', function () {
this.timeout(10000)
const bigmath = math.create({ number: 'BigNumber', precision: 64 })
assert.deepStrictEqual(bigmath.simplify('111111111111111111 + 111111111111111111').evaluate(), bigmath.evaluate('222222222222222222'))
assert.deepStrictEqual(bigmath.simplify('1 + 111111111111111111').evaluate(), bigmath.evaluate('111111111111111112'))

View File

@ -246,8 +246,6 @@ describe('pow', function () {
})
it('should compute large size of square matrix', function () {
this.timeout(10000)
const a = math.identity(30).valueOf()
approx.deepEqual(pow(a, 1000), a)
approx.deepEqual(pow(matrix(a), 1000), matrix(a))

View File

@ -916,8 +916,6 @@ describe('Unit', function () {
})
it('should parse the value of the unit as Fraction or BigNumber when math.js is configured so', function () {
this.timeout(10000) // For IE tests
const math2 = math.create({ number: 'Fraction' })
const unit2 = math2.Unit.parse('5kg')
assert(isFraction(unit2.value))