mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
Updating forEach to handle non iterable values
This commit is contained in:
@@ -29,5 +29,27 @@ module.exports = {
|
||||
test.equal(keys, 'bar');
|
||||
test.equal(vals, 6);
|
||||
test.done();
|
||||
},
|
||||
|
||||
testUndefined: function (test) {
|
||||
var count = 0;
|
||||
|
||||
forEach(undefined, function () {
|
||||
count++;
|
||||
});
|
||||
|
||||
test.equals(count, 0);
|
||||
test.done();
|
||||
},
|
||||
|
||||
testFunction: function (test) {
|
||||
var count = 0;
|
||||
|
||||
forEach(function () {}, function () {
|
||||
count++;
|
||||
})
|
||||
|
||||
test.equals(count, 1);
|
||||
test.done();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user