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

Fix #157 #159

Merged
merged 1 commit into from
Oct 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/ext/contain.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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