Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: add test for chained plugin usage
  • Loading branch information
43081j committed Jan 7, 2025
commit 383a3b68120204b42fdd04613354693ebeafadec
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
Loading