mirror of
https://github.com/chaijs/chai
synced 2024-11-15 08:17:14 +00:00
26 lines
518 B
JavaScript
26 lines
518 B
JavaScript
if (!chai) {
|
|
var chai = require('..');
|
|
}
|
|
|
|
suite('plugins', function () {
|
|
|
|
function plugin (chai) {
|
|
Object.defineProperty(chai.Assertion.prototype, 'testing', {
|
|
get: function () {
|
|
return 'successful';
|
|
}
|
|
});
|
|
}
|
|
|
|
test('basic usage', function () {
|
|
chai.use(plugin);
|
|
var expect = chai.expect;
|
|
expect(expect('').testing).to.equal('successful');
|
|
});
|
|
|
|
test('double plugin', function () {
|
|
chai.expect(function () {
|
|
chai.use(plugin);
|
|
}).to.not.throw();
|
|
});
|
|
});
|