diff --git a/test/plugins.js b/test/plugins.js index f9125b18..c9c013cc 100644 --- a/test/plugins.js +++ b/test/plugins.js @@ -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', {