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 faf1d82 commit c6af839
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,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
6 changes: 3 additions & 3 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');

var setEqual = function compareSetLikes(t, actual, expected, msg) {
t.test('setlikes: ' + msg, function (st) {
Expand Down Expand Up @@ -344,7 +345,6 @@ module.exports = function (intersection, t) {
var setlikeWithMinusZero = {
size: 1,
has: function () {
// impossible to avoid this call since we do not have internal set data access
throw new EvalError('Set.prototype.intersection should not invoke .has on its argument when this.size > arg.size');
},
keys: function () {
Expand Down Expand Up @@ -381,7 +381,7 @@ module.exports = function (intersection, t) {
size: 2,
has: undefined,
keys: function () {
return [2, 3];
return getIterator([2, 3]);
}
};
st['throws'](
Expand Down Expand Up @@ -486,7 +486,7 @@ module.exports = function (intersection, t) {
size: undefined,
has: function () {},
keys: function () {
return [2, 3];
return getIterator([2, 3]);
}
};
st['throws'](
Expand Down

0 comments on commit c6af839

Please sign in to comment.