Skip to content

Commit

Permalink
test: add test for chained plugin usage
Browse files Browse the repository at this point in the history
  • Loading branch information
43081j committed Jan 7, 2025
1 parent cfff1cd commit 383a3b6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ describe('plugins', function () {
expect(expect('').testing).to.equal('successful');
});

it('chained plugin', function () {
chai.use(function (chaiObj) {
Object.defineProperty(chaiObj.Assertion.prototype, 'testing2', {
get() {
return 'bleep bloop';
}
});
}).use(plugin);
var expect = chai.expect;
expect(expect('').testing).to.equal('successful');
expect(expect('').testing2).to.equal('bleep bloop');
});

it('.use detached from chai object', function () {
function anotherPlugin (chai) {
Object.defineProperty(chai.Assertion.prototype, 'moreTesting', {
Expand Down

0 comments on commit 383a3b6

Please sign in to comment.