mirror of
https://github.com/actions/labeler.git
synced 2025-12-17 23:59:40 +00:00
build
This commit is contained in:
28
node_modules/object-inspect/test/fn.js
generated
vendored
Normal file
28
node_modules/object-inspect/test/fn.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
var inspect = require('../');
|
||||
var test = require('tape');
|
||||
|
||||
test('function', function (t) {
|
||||
t.plan(1);
|
||||
var obj = [1, 2, function f(n) { return n; }, 4];
|
||||
t.equal(inspect(obj), '[ 1, 2, [Function: f], 4 ]');
|
||||
});
|
||||
|
||||
test('function name', function (t) {
|
||||
t.plan(1);
|
||||
var f = (function () {
|
||||
return function () {};
|
||||
}());
|
||||
f.toString = function () { return 'function xxx () {}'; };
|
||||
var obj = [1, 2, f, 4];
|
||||
t.equal(inspect(obj), '[ 1, 2, [Function (anonymous)], 4 ]');
|
||||
});
|
||||
|
||||
test('anon function', function (t) {
|
||||
var f = (function () {
|
||||
return function () {};
|
||||
}());
|
||||
var obj = [1, 2, f, 4];
|
||||
t.equal(inspect(obj), '[ 1, 2, [Function (anonymous)], 4 ]');
|
||||
|
||||
t.end();
|
||||
});
|
||||
Reference in New Issue
Block a user