Mocha + Benchmark integration
Mocha + Benchmark + Chai, support sync and async test
install
npm i mocha-benchmark2 mocha chai benchmark microtime
usage
mocha --require mocha-benchmark2/register test/demo.test.demo.js
u can use this with normal mocha test at same time
mocha --require mocha-benchmark2/register "!(node_modules|demo)/**/*.+(test|spec).js" test/demo.test.demo.js
lazy cli
this cli help u skip
--require mocha-benchmark2/register
mocha-benchmark2 "!(node_modules|demo)/**/*.+(test|spec).js" test/demo.test.demo.js
ide support (ex: idea)
register
when u require mocha-benchmark2/register
will auto try import if u have installed
this will not overwrite if it already exists in global
assert
=>chai.assert
or node.jsassert
should
=>chai.should
expect
=>chai.expect
MochaBenchmark
=>mocha-benchmark2
Benchmark
=>benchmark
API
demo
/** * Created by user on 2018/6/2/002. */; ; bench.suiterelative__filename, ;