frontend/.pnpm-store/v3/files/4f/059e440b5d112b421e64595aa560d92a5d054303c36c64a6151fef6049dfce01a9fde4a9735836ecb2a09926aaf886f2a017d7ad9a4f1b1d19ecb8f1fe601b

31 lines
847 B
Plaintext

'use strict';
var test = require('tape');
var callBind = require('call-bind');
var allSettled = require('../implementation');
var runTests = require('./tests');
var bound = callBind(allSettled);
// eslint-disable-next-line no-shadow
var rebindable = function allSettled(iterable) {
// eslint-disable-next-line no-invalid-this
return bound(typeof this === 'undefined' ? Promise : this, iterable);
};
test('as a function', function (t) {
t.test('bad Promise/this value', function (st) {
// eslint-disable-next-line no-useless-call
st['throws'](function () { allSettled.call(undefined, []); }, TypeError, 'undefined is not an object');
// eslint-disable-next-line no-useless-call
st['throws'](function () { allSettled.call(null, []); }, TypeError, 'null is not an object');
st.end();
});
runTests(rebindable, t);
t.end();
});