Skip to content

Commit

Permalink
test: make sure that useProxy config is checked in overwriteProperty
Browse files Browse the repository at this point in the history
  • Loading branch information
vieiralucas committed Jun 5, 2019
1 parent 18d8494 commit 42509fa
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions test/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 42509fa

Please sign in to comment.