piapia
Just a wrapped tap, more fun.
Install
$ npm i -D piapia
Usage
package.json
"scripts": "test": "piapia 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
piapia
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 piapia
is exactly the same as tap
.
For example, if we want to use piapia
with codecov
$ npm i -D piapia codecov
package.json
"scripts": "test": "piapia test/index.js --coverage" "posttest": "piapia --coverage-report=html && codecov"
License
MIT