Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

Commit

Permalink
Merge pull request #159 from shouldjs/fix-157
Browse files Browse the repository at this point in the history
Fix #157
  • Loading branch information
btd committed Oct 28, 2017
2 parents ff0877a + 6a7989f commit 1e7b1d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ext/contain.js
Expand Up @@ -138,7 +138,7 @@ export default function(should, Assertion) {
this.params = { operator: "to contain " + i(other) };

var obj = this.obj;
if (typeof obj == "string") {
if (typeof obj === "string" && typeof other === "string") {
// expect other to be string
this.is.equal(String(other));
} else if (isIterable(obj) && isIterable(other)) {
Expand Down
1 change: 1 addition & 0 deletions test/ext/contain.test.js
Expand Up @@ -54,6 +54,7 @@ describe("contain*", function() {
[1, 2, 3].should.containDeep([3, 2]);

["code-for-days", "code"].should.containDeep(["code", "code-for-days"]);
({ a: "hello" }.should.not.containDeep({ a: ["hello"] }));
["code-for-days", "code-fast"].should.containDeep(["code-fast", "code-for-days"]);

err(function() {
Expand Down

0 comments on commit 1e7b1d0

Please sign in to comment.