Tape-Enzyme is a micro library that helps you use tape with enzyme.
- Use NPM:
npm i --save tape-enzyme
Tape-Enzyme is a proxy of tape, but it has better functionality.
Import library and use as tape
test:
import test from 'tape-enzyme'
You can also add plugins to your current tape
instance:
import test from 'tape'
import {registration} from 'tape-enzyme'
export default registration(test)
Use three types of testing utils:
You can add your own methods using init
:
- @param { String } methodName
- @param { Function } func
Example:
test.init('notStrictEqual', function (actual, expected, msg) {
this.operator(actual, '!==', expected, msg)
})
test('notStrictEqual test', t => {
t.notStrictEqual(3, '3', 'should be not strict equality')
t.end()
})
- You have
node
installed at v4.0.0+ andnpm
at v2.0.0+. - You are familiar with
git
.
$ git clone <this repo>
$ cd tape-enzyme
$ npm install
Linters:
$ npm run test:lint
Unit tests:
$ npm run test:unit
All tests:
$ npm run test
The main purpose of this library is to make writing tests with tape
easier. It involves less code while being more expressive and as robust as possible. If you think that we are missing any key features, please open a GitHub issue, or even better, a pull request. Any feedback you have about using tape-enzyme
would be greatly appreciated.
Tape-enzyme is Apache 2.0 licensed.