Skip to content

Commit 4ff1976

Browse files
committed
[Tests] ensure test mocks return iterators
1 parent 52a6f9f commit 4ff1976

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
"@ljharb/eslint-config": "^21.1.0",
7575
"aud": "^2.0.4",
7676
"auto-changelog": "^2.4.0",
77+
"es-get-iterator": "^1.1.3",
7778
"es-map": "^1.0.5",
7879
"es-value-fixtures": "^1.4.2",
7980
"es6-shim": "^0.35.8",

test/tests.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ var forEach = require('for-each');
55
var v = require('es-value-fixtures');
66
var debug = require('object-inspect');
77
var $Map = require('es-map/polyfill')();
8+
var getIterator = require('es-get-iterator');
89

910
module.exports = function (isDisjointFrom, t) {
1011
t.test('throws on non-set receivers', function (st) {
@@ -183,7 +184,7 @@ module.exports = function (isDisjointFrom, t) {
183184
size: 2,
184185
has: undefined,
185186
keys: function () {
186-
return [2, 3];
187+
return getIterator([2, 3]);
187188
}
188189
};
189190
st['throws'](
@@ -248,7 +249,7 @@ module.exports = function (isDisjointFrom, t) {
248249
size: undefined,
249250
has: function () {},
250251
keys: function () {
251-
return [2, 3];
252+
return getIterator([2, 3]);
252253
}
253254
};
254255

0 commit comments

Comments
 (0)