How to use the functions-have-names.boundFunctionsHaveNames function in functions-have-names

To help you get started, we’ve selected a few functions-have-names examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github es-shims / AggregateError / test / tests.js View on Github external
'use strict';

var functionsHaveNames = require('functions-have-names')();
var boundFunctionsHaveNames = require('functions-have-names').boundFunctionsHaveNames();
var forEach = require('for-each');
var inspect = require('object-inspect');

module.exports = function (AggregateError, t) {
	t.test('constructor', function (st) {
		st.equal(typeof AggregateError, 'function', 'is a function');

		st.equal(AggregateError.length, 2, 'AggregateError has a length of 2');

		st.test('Function name', { skip: !functionsHaveNames || !boundFunctionsHaveNames }, function (s2t) {
			s2t.equal(AggregateError.name, 'AggregateError', 'AggregateError has name "AggregateError"');
			s2t.end();
		});

		st.end();
	});

functions-have-names

Does this JS environment support the `name` property on functions?

MIT
Latest version published 3 years ago

Package Health Score

67 / 100
Full package analysis