mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Additional tests for Meteor._delete
This commit is contained in:
@@ -37,6 +37,8 @@ _.extend(Meteor, {
|
||||
break;
|
||||
}
|
||||
obj = obj[key];
|
||||
if (typeof obj !== "object")
|
||||
break;
|
||||
stack.push(obj);
|
||||
}
|
||||
|
||||
|
||||
@@ -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});
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user