Tape-Enzyme is a micro library that helps you use tape with enzyme.
- Use NPM:
npm i --save tape-enzymeTape-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
nodeinstalled at v4.0.0+ andnpmat v2.0.0+. - You are familiar with
git.
$ git clone <this repo>
$ cd tape-enzyme
$ npm installLinters:
$ npm run test:lintUnit tests:
$ npm run test:unitAll tests:
$ npm run testThe 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.