mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Fix tinytest include to use _.isEqual
This commit is contained in:
committed by
David Glasser
parent
3068fd1a36
commit
76dba0150d
@@ -917,7 +917,7 @@ Tinytest.add("livedata stub - multiple stubs same doc", function (test) {
|
||||
// Method sent.
|
||||
var updateMethodId = testGotMessage(
|
||||
test, stream, {msg: 'method', method: 'updateIt',
|
||||
params: [{$type: 'oid', $value: stubWrittenId.valueOf()}], id: '*'});
|
||||
params: [stubWrittenId], id: '*'});
|
||||
test.equal(stream.sent.length, 0);
|
||||
|
||||
// Get some data... slightly different than what we wrote.
|
||||
|
||||
@@ -205,7 +205,7 @@ _.extend(TestCaseResults.prototype, {
|
||||
include: function (s, v) {
|
||||
var pass = false;
|
||||
if (s instanceof Array)
|
||||
pass = _.indexOf(s, v) !== -1;
|
||||
pass = _.any(s, function(it) {return _.isEqual(v, it);});
|
||||
else if (typeof s === "object")
|
||||
pass = v in s;
|
||||
else if (typeof s === "string")
|
||||
@@ -218,8 +218,9 @@ _.extend(TestCaseResults.prototype, {
|
||||
/* fail -- not something that contains other things */;
|
||||
if (pass)
|
||||
this.ok();
|
||||
else
|
||||
else {
|
||||
this.fail({type: "include", sequence: s, should_contain_value: v});
|
||||
}
|
||||
},
|
||||
|
||||
// XXX should change to lengthOf to match vowsjs
|
||||
|
||||
Reference in New Issue
Block a user