Additional tests for Meteor._delete

This commit is contained in:
Geoff Schmidt
2012-03-07 01:47:35 -08:00
parent 168bc8e570
commit dc880b1d1e
3 changed files with 11 additions and 1 deletions

View File

@@ -37,6 +37,8 @@ _.extend(Meteor, {
break;
}
obj = obj[key];
if (typeof obj !== "object")
break;
stack.push(obj);
}

View File

@@ -51,6 +51,14 @@ Tinytest.add("environment - helpers", function (test) {
Meteor._delete(x, "a", "b", "c");
test.equal(x, {});
x = {a: {b: 99}};
Meteor._delete(x, "a", "b", "c", "d");
test.equal(x, {});
x = {a: {b: 99}};
Meteor._delete(x, "a", "b", "c", "d", "e", "f");
test.equal(x, {});
x = {a: {b: {c: {d: 99}}}, x: 12};
Meteor._delete(x, "a", "b", "c", "d");
test.equal(x, {x: 12});

View File

@@ -42,7 +42,7 @@ _.extend(TestCaseResults.prototype, {
var now = (+new Date);
debugger;
if ((+new Date) - now < 100)
alert("To use this feature, first open the debugger window in your browser.");
alert("To use this feature, first enable your browser's debugger.");
}
self.stop_at_offset = null;
}