aya
Just a wrapped tap, more fun.
Install
$ npm i -D aya
Usage
package.json
"scripts": "test": "aya test/index.js --coverage"
test/index.js
const test = test
And then
$ npm test
t.end()
only in test.cb
Unlike tap
, we should only use t.end()
in test.cb
.
test
t.end()
is NO MORE necessary for test
Lifecycles
aya
supports FOUR lifecycle methods which are listed below according to the executing sequence:
test.before(fn)
test.beforeEach(fn)
test.afterEach(fn)
test.after(fn)
// Both sync and async functions are supportedtest
We could also define lifecycle methods by using setters:
testbefore = async { await t}
Command Line
The command line interface of aya
is exactly the same as tap
.
For example, if we want to use aya
with codecov
$ npm i -D aya codecov
package.json
"scripts": "test": "aya test/index.js --coverage" "posttest": "aya --coverage-report=html && codecov"
License
MIT