This commit is contained in:
Lukian LEIZOUR 2022-11-26 15:56:34 +01:00
parent 70e2f7a8aa
commit 008d2f30d7
675 changed files with 189892 additions and 0 deletions

40
node_modules/hang/test.js generated vendored Normal file
View file

@ -0,0 +1,40 @@
describe('hang', function () {
'use strict';
var hang = require('./')
, assume = require('assume');
it('is exported as a function', function () {
assume(hang).is.a('function');
});
it('returns a function with the same name as the provided fn', function () {
var what = hang(function what() {});
assume(what.displayName).equals('what');
});
it('calls the supplied callback', function (next) {
var h = hang(next);
assume(h).does.not.equals(next);
h();
});
it('instantly calls the supplied function if called async', function (next) {
setImmediate(hang(next));
});
it('proxies the arguments and this value', function (next) {
var fn = hang(function (a, b, c) {
assume(a).equals('a');
assume(b).equals('b');
assume(c).equals('c');
assume(this).equals('foo');
next();
});
fn.apply('foo', ['a', 'b', 'c']);
});
});