From 42509fac016182ddde8b4edf9ff3ff1ce285cebf Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Tue, 28 May 2019 13:50:14 -0300 Subject: [PATCH] test: make sure that useProxy config is checked in overwriteProperty --- test/utilities.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/test/utilities.js b/test/utilities.js index bb3db59..4c84a6b 100644 --- a/test/utilities.js +++ b/test/utilities.js @@ -596,14 +596,24 @@ describe('utilities', function () { expect(expect([1, 2, 3]).foo).to.be.an.instanceOf(assertionConstructor); }); - it('overwriteProperty sets `ssfi` when `lockSsfi` isn\'t set', function () { - var origAssertion = expect(4); - var origSsfi = utils.flag(origAssertion, 'ssfi'); + describe('when useProxy is false', function () { + before(function () { + chai.config.useProxy = false; + }); - var newAssertion = origAssertion.to.be.four; - var newSsfi = utils.flag(newAssertion, 'ssfi'); + after(function () { + chai.config.useProxy = true; + }); - expect(origSsfi).to.not.equal(newSsfi); + it('overwriteProperty sets `ssfi` when `lockSsfi` isn\'t set', function () { + var origAssertion = expect(4); + var origSsfi = utils.flag(origAssertion, 'ssfi'); + + var newAssertion = origAssertion.to.be.four; + var newSsfi = utils.flag(newAssertion, 'ssfi'); + + expect(origSsfi).to.not.equal(newSsfi); + }); }); it('overwriteProperty doesn\'t set `ssfi` when `lockSsfi` is set', function () {