Skip to content
Jayson Harshbarger edited this page May 28, 2016 · 4 revisions

Why not use benchmark.js

Chūhai uses benchmark.js internally. Benchmark.js does not include any reporters or runners. To combine benchmark.js with a test harness, especially an asynchronous one like AVA, can be difficult.

Where is the runner?

Currently, Chūhai does not include a runner. Use node directly (for loop in a shell script works well) or a tap test runner. Tap test runners (including node-tap, blue-tape, babel-tape-runner) work, even without tape tests. However, currently, only node-tap and AVAjs run each test in a child process. I may add a runner in the future.

Why not Matcha?

Matcha is cool. But is is primarily a runner and reporter. Matcha's internal reporters are not suited for asynchronous running, like when using AVA, and the exposed API does not integrate easily with test runners. Also, Matcha follows the mocha style of test configuration, using magic implicit globals. Chūhai follows along the lines of node-tap, Tape and AVA. Also, the Matcha runner, like substack/tape and unlike node-tap and AVA, runs all files in a single process.

No ES6 support?

This depends on the test runner. Try AVA or babel-tape-runner.

Can I use custom benchmark reporters?

Currently no. Chūhai contains a single reporter, the test reporter is the responsibility of the test harness. Using TAP output you can run the results through a tap-reporter.

Wait!? Doesn't this produce invalid TAP output?

Yes, that is true. However, many TAP consumers treat extra output as a comments. Try zoubin/tap-summary for example. Take a look at Hypercubed/tap-summary#tap-summary-markdown for something coming.