big.js/test/every-test.js
Michael Mclaughlin 0b79acd7aa Rename Big.E_POS to Big.PE, Big.E_NEG to Big.NE.
Refactor error messaging. Throw if null is passed to toFixed etc. and amend tests accordingly. Clean-up and reformat.
2017-09-27 22:14:56 +01:00

31 lines
514 B
JavaScript

var arr,
passed = 0,
total = 0,
start = +new Date();
console.log( '\n STARTING TESTS...\n' );
[
'abs',
'div',
'cmp',
'minus',
'mod',
'plus',
'pow',
'round',
'sqrt',
'times',
'toExponential',
'toFixed',
'toPrecision',
'toString'
]
.forEach( function (method) {
arr = require('./' + method);
passed += arr[0];
total += arr[1];
});
console.log( '\n RESULTS: ' + passed + ' of ' + total + ' tests passed in ' +
( (+new Date() - start) / 1000 ) + ' secs.\n' );