tape-chai

1.1.0 • Public • Published

Tape Chai.js

Chai.js Assertions for Tape

What?

This is just the Assert API from Chai.js. This builds upon my Assertive Chai project, and tailors it for use with Tape.

I borrowed the unit tests from Chai.js. :)

Why?

  • Chai.js requires ECMAScript 5, making it a poor choice for projects that need to span a wide variety of browsers

  • I don't feel BDD-style assertions are worth the hassle of having to learn what is frequently an inconsistent API

  • BDD makes more sense at the test framework level, and it's easy to integrate Chai.js (and this library) with any test framework you like

How?

Tape Chai.js modifies the Test prototype provided by Tape.

Node.js

npm install tape --save-dev
npm install tape-chai --save-dev
var test = require('tape');
require('tape-chai');
 
test('[] is an Array', function (t) {
  t.isArray([]);
  t.end();
});

Browser

Use Browserify

Development

Node.js

npm test

Browser

Use Browserify

npm run-script compile

Then load tests/index.html in your browser.

Dependencies (3)

Dev Dependencies (5)

Package Sidebar

Install

npm i tape-chai

Weekly Downloads

11

Version

1.1.0

License

BSD

Last publish

Collaborators

  • jokeyrhyme