Skip to content

Commit

Permalink
Make changes after merging
Browse files Browse the repository at this point in the history
  • Loading branch information
koddsson committed Feb 11, 2024
1 parent 393e2ea commit d3a37bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
26 changes: 10 additions & 16 deletions lib/chai/core/assertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,6 @@ function an (type, msg) {
, 'expected #{this} to be ' + article + type
, 'expected #{this} not to be ' + article + type
);
} else if (type === 'iterable') {
this.assert(
typeof obj !== 'string' && obj != undefined && obj[Symbol.iterator]
, 'expected #{this} to be ' + article + type
, 'expected #{this} not to be ' + article + type
);
} else {
this.assert(
type === detectedType
Expand All @@ -337,14 +331,6 @@ function an (type, msg) {
Assertion.addChainableMethod('an', an);
Assertion.addChainableMethod('a', an);

function SameValueZero(a, b) {
return (_.isNaN(a) && _.isNaN(b)) || a === b;
}

function includeChainingBehavior () {
flag(this, 'contains', true);
}

/**
* ### .include(val[, msg])
*
Expand Down Expand Up @@ -492,6 +478,14 @@ function includeChainingBehavior () {
* @api public
*/

function SameValueZero(a, b) {
return (_.isNaN(a) && _.isNaN(b)) || a === b;
}

function includeChainingBehavior () {
flag(this, 'contains', true);
}

function include (val, msg) {
if (msg) flag(this, 'message', msg);

Expand Down Expand Up @@ -3147,8 +3141,8 @@ Assertion.addMethod('members', function (subset, msg) {
, flagMsg = flag(this, 'message')
, ssfi = flag(this, 'ssfi');

new Assertion(obj, flagMsg, ssfi, true).to.be.an('iterable');
new Assertion(subset, flagMsg, ssfi, true).to.be.an('iterable');
new Assertion(obj, flagMsg, ssfi, true).to.be.iterable;
new Assertion(subset, flagMsg, ssfi, true).to.be.iterable;

var contains = flag(this, 'contains');
var ordered = flag(this, 'ordered');
Expand Down
4 changes: 2 additions & 2 deletions test/should.js
Original file line number Diff line number Diff line change
Expand Up @@ -2815,11 +2815,11 @@ describe('should', function() {

err(function() {
'foo'.should.include.members([12], 'blah');
}, "blah: expected 'foo' to be an iterable");
}, "blah: expected 'foo' to be a superset of [ 12 ]");

err(function() {
[1, 2, 3].should.include.members('o', 'blah');
}, "blah: expected 'o' to be an iterable");
}, "blah: expected [ 1, 2, 3 ] to be a superset of 'o'");
});

it('memberEquals', function() {
Expand Down

0 comments on commit d3a37bf

Please sign in to comment.