Skip to content

Commit

Permalink
[Tests] use call-bind instead of function-bind
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Mar 19, 2024
1 parent 7ecec4a commit ad68fef
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 @@ -63,7 +63,6 @@
"eslint": "=8.8.0",
"evalmd": "^0.0.19",
"foreach": "^2.0.6",
"function-bind": "^1.1.1",
"functions-have-names": "^1.2.3",
"globalthis": "^1.0.3",
"has-strict-mode": "^1.0.1",
Expand Down
8 changes: 4 additions & 4 deletions test/implementation.js
@@ -1,14 +1,14 @@
var some = require('../implementation');
var bind = require('function-bind');
var callBind = require('call-bind');
var test = require('tape');
var hasStrictMode = require('has-strict-mode')();

var runTests = require('./tests');

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

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

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

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

var some = require('../');
var bind = require('function-bind');
var callBind = require('call-bind');
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(some, null, undefined, 'a'), TypeError, 'undefined is not an object');
st['throws'](bind.call(some, null, null, 'a'), TypeError, 'null is not an object');
st['throws'](callBind(some, null, undefined, 'a'), TypeError, 'undefined is not an object');
st['throws'](callBind(some, 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('../auto');

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

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

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

t.end();
});

0 comments on commit ad68fef

Please sign in to comment.