Skip to content

Commit

Permalink
[Tests] ensure test mocks return iterators
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Dec 18, 2023
1 parent 52a6f9f commit 4ff1976
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"@ljharb/eslint-config": "^21.1.0",
"aud": "^2.0.4",
"auto-changelog": "^2.4.0",
"es-get-iterator": "^1.1.3",
"es-map": "^1.0.5",
"es-value-fixtures": "^1.4.2",
"es6-shim": "^0.35.8",
Expand Down
5 changes: 3 additions & 2 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var forEach = require('for-each');
var v = require('es-value-fixtures');
var debug = require('object-inspect');
var $Map = require('es-map/polyfill')();
var getIterator = require('es-get-iterator');

module.exports = function (isDisjointFrom, t) {
t.test('throws on non-set receivers', function (st) {
Expand Down Expand Up @@ -183,7 +184,7 @@ module.exports = function (isDisjointFrom, t) {
size: 2,
has: undefined,
keys: function () {
return [2, 3];
return getIterator([2, 3]);
}
};
st['throws'](
Expand Down Expand Up @@ -248,7 +249,7 @@ module.exports = function (isDisjointFrom, t) {
size: undefined,
has: function () {},
keys: function () {
return [2, 3];
return getIterator([2, 3]);
}
};

Expand Down

0 comments on commit 4ff1976

Please sign in to comment.