Skip to content

Commit

Permalink
[Tests] use callBind from es-abstract instead of function-bind
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Feb 1, 2020
1 parent 3a06d5f commit 13e3287
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -62,7 +62,6 @@
"eslint": "^6.8.0",
"evalmd": "^0.0.19",
"foreach": "^2.0.5",
"function-bind": "^1.1.1",
"functions-have-names": "^1.2.1",
"has-strict-mode": "^1.0.0",
"indexof": "^0.0.1",
Expand Down
8 changes: 4 additions & 4 deletions test/implementation.js
@@ -1,14 +1,14 @@
var every = require('../implementation');
var bind = require('function-bind');
var callBind = require('es-abstract/helpers/callBind');
var test = require('tape');
var runTests = require('./tests');

var hasStrictMode = require('has-strict-mode')();

test('as a function', function (t) {
t.test('bad array/this value', function (st) {
st['throws'](bind.call(every, null, undefined, 'a'), TypeError, 'undefined is not an object');
st['throws'](bind.call(every, null, null, 'a'), TypeError, 'null is not an object');
st['throws'](callBind(every, null, undefined, 'a'), TypeError, 'undefined is not an object');
st['throws'](callBind(every, null, null, 'a'), TypeError, 'null is not an object');
st.end();
});

Expand Down Expand Up @@ -37,7 +37,7 @@ test('as a function', function (t) {
st.end();
});

runTests(bind.call(Function.call, every), t);
runTests(callBind(every), t);

t.end();
});
6 changes: 3 additions & 3 deletions test/index.js
@@ -1,14 +1,14 @@
'use strict';

var every = require('../');
var bind = require('function-bind');
var callBind = require('es-abstract/helpers/callBind');
var test = require('tape');
var runTests = require('./tests');

test('as a function', function (t) {
t.test('bad array/this value', function (st) {
st['throws'](bind.call(every, null, undefined, 'a'), TypeError, 'undefined is not an object');
st['throws'](bind.call(every, null, null, 'a'), TypeError, 'null is not an object');
st['throws'](callBind(every, null, undefined, 'a'), TypeError, 'undefined is not an object');
st['throws'](callBind(every, null, null, 'a'), TypeError, 'null is not an object');
st.end();
});

Expand Down
4 changes: 2 additions & 2 deletions test/shimmed.js
Expand Up @@ -2,7 +2,7 @@ require('../shim')();

var test = require('tape');
var defineProperties = require('define-properties');
var bind = require('function-bind');
var callBind = require('es-abstract/helpers/callBind');
var hasStrictMode = require('has-strict-mode')();

var isEnumerable = Object.prototype.propertyIsEnumerable;
Expand Down Expand Up @@ -55,7 +55,7 @@ test('shimmed', function (t) {
st.end();
});

runTests(bind.call(Function.call, Array.prototype.every), t);
runTests(callBind(Array.prototype.every), t);

t.end();
});

0 comments on commit 13e3287

Please sign in to comment.