chai-qunit
chai integrations for qunit
Last updated 6 years ago by fivetanley .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install chai-qunit 
SYNC missed versions from official npm registry.

Chai QUnit Build Status

Chai-QUnit is a layer on top of QUnit using the chai assertion library.

Installation

bower install --save-dev chai-qunit

or

npm install --save-dev chai-qunit

Then include it using a script tag:

<script type="text/javascript" src="/path/to/bower_components/chai-qunit/dist/chai-qunit.js">
  chaiQUnit.globalize();
</script>

or use your favorite module system (AMD, CJS, ES6):

var chaiQUnit = require('chai-qunit');
chaiQUnit.globalize();

Why

Chai tends to have better error messages if you don't provide one yourself, and has a bunch of other useful helpers(like include, match, etc.) and a robust plugin system for creating your own.

Usage

See the Chai Docs for more usage information, but this implementation currently uses the assert syntax exposed as globals (expect and should are planned to be supported soon). For example, with chai standalone, you would say assert.matches("hello", /hello/i). In chai-qunit, you would say matches("hello", /hello/i).

Test Example


module("My Module");

test("title matches something", function(){
  var title = "A Book about Nothing";
  matches(title, /book/i);
});

License

MIT. See the LICENSE file included with this repository.

Current Tags

  • 0.1.0                                ...           latest (6 years ago)

1 Versions

  • 0.1.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (13)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |