chai/test/plugins.js
Jake Luer a8f94bdcbb test: [karma] use karma phantomjs runner
- tests refactored as bdd instead of tdd
- removed test/browser bootstraps
- add karma-runner
2013-09-17 17:22:36 -04:00

24 lines
524 B
JavaScript

describe('plugins', function () {
function plugin (chai) {
if (chai.Assertion.prototype.testing) return;
Object.defineProperty(chai.Assertion.prototype, 'testing', {
get: function () {
return 'successful';
}
});
}
it('basic usage', function () {
chai.use(plugin);
var expect = chai.expect;
expect(expect('').testing).to.equal('successful');
});
it('double plugin', function () {
chai.expect(function () {
chai.use(plugin);
}).to.not.throw();
});
});