tests: Update package.json, shorten test runtime

This commit is contained in:
Colin Caine 2017-10-05 03:55:42 +01:00
parent 07bcf762d0
commit e2ccd3da4a
2 changed files with 3 additions and 3 deletions

View file

@ -23,7 +23,7 @@
"scripts": { "scripts": {
"build": "webpack", "build": "webpack",
"clean": "rm -rf build", "clean": "rm -rf build",
"test": "npm run build", "test": "npm run build && jest --silent",
"update-buildsystem": "rm -rf src/node_modules; npm run clean" "update-buildsystem": "rm -rf src/node_modules; npm run clean"
}, },
"jest": { "jest": {

View file

@ -43,7 +43,7 @@ for (let [a, b, ans] of testcases) {
/** Test with mixed dividend, positive divisor */ /** Test with mixed dividend, positive divisor */
for (let i=0; i<1000; i++) { for (let i=0; i<100; i++) {
let a = (Math.random()-0.5) * 10000|0 let a = (Math.random()-0.5) * 10000|0
let b = Math.random() * 10000|0 let b = Math.random() * 10000|0
b = b === 0 ? 17 : b // Don't be 0. b = b === 0 ? 17 : b // Don't be 0.
@ -55,7 +55,7 @@ for (let i=0; i<1000; i++) {
} }
/** Test with a mix of +ve and -ve */ /** Test with a mix of +ve and -ve */
for (let i=0; i<1000; i++) { for (let i=0; i<100; i++) {
let a = (Math.random()-0.5) * 10000|0 let a = (Math.random()-0.5) * 10000|0
let b = (Math.random()-0.5) * 10000|0 let b = (Math.random()-0.5) * 10000|0
b = b === 0 ? 17 : b // Don't be 0. b = b === 0 ? 17 : b // Don't be 0.