Skip to content

Commit

Permalink
[Dev Deps] update eslint, @ljharb/eslint-config, tape, `make-ar…
Browse files Browse the repository at this point in the history
…row-function`, `make-generator-function`; add `make-async-function`
  • Loading branch information
ljharb committed Feb 2, 2020
1 parent a9ba8a3 commit e498133
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 27 deletions.
12 changes: 7 additions & 5 deletions package.json
Expand Up @@ -39,14 +39,16 @@
},
"devDependencies": {
"@es-shims/api": "^2.1.2",
"@ljharb/eslint-config": "^15.0.2",
"@ljharb/eslint-config": "^16.0.0",
"covert": "^1.1.1",
"eclint": "^2.8.1",
"eslint": "^6.7.2",
"make-arrow-function": "^1.1.0",
"make-generator-function": "^1.1.0",
"eslint": "^6.8.0",
"for-each": "^0.3.3",
"make-arrow-function": "^1.2.0",
"make-async-function": "^1.0.0",
"make-generator-function": "^2.0.0",
"safe-publish-latest": "^1.1.4",
"tape": "^4.11.0",
"tape": "^5.0.0-next.4",
"uglify-register": "^1.0.1"
},
"testling": {
Expand Down
44 changes: 22 additions & 22 deletions test/tests.js
@@ -1,8 +1,10 @@
'use strict';

var functionsHaveNames = require('functions-have-names')();
var arrowFn = require('make-arrow-function')();
var genFn = require('make-generator-function');
var arrows = require('make-arrow-function').list();
var generators = require('make-generator-function')();
var asyncs = require('make-async-function').list();
var forEach = require('for-each');

var foo = Object(function foo() {});
var anon = Object(function () {});
Expand All @@ -22,29 +24,27 @@ module.exports = function (getName, t) {
st.end();
});

t.test('arrow functions', { skip: !arrowFn }, function (st) {
if (functionsHaveNames) {
st.equal(getName(arrowFn), arrowFn.name, 'arrow function name matches');
}
st.equal(getName(arrowFn), '', 'arrow function has correct name');
t.test('arrow functions', { skip: arrows.length === 0 }, function (st) {
st.equal(true, functionsHaveNames, 'functions have names in any env with arrow functions');
forEach(arrows, function (arrowFn) {
st.equal(getName(arrowFn), arrowFn.name, 'arrow function name matches for ' + arrowFn);
});
st.end();
});

t.test('generators', { skip: !genFn }, function (st) {
if (functionsHaveNames) {
st.equal(getName(genFn), genFn.name, 'generator function name matches');
if (genFn.concise) {
st.equal(getName(genFn.concise), genFn.concise.name, 'concise generator function name matches');
} else {
st.skip('concise generator functions not supported');
}
}
st.equal(getName(genFn), '', 'generator function has correct name');
if (genFn.concise) {
st.equal(getName(genFn.concise), 'gen', 'concise generator function has correct name');
} else {
st.skip('concise generator functions not supported');
}
t.test('generators', { skip: generators.length === 0 }, function (st) {
st.equal(true, functionsHaveNames, 'functions have names in any env with generator functions');
forEach(generators, function (genFn) {
st.equal(getName(genFn), genFn.name, 'generator function name matches for ' + genFn);
});
st.end();
});

t.test('asyncs', { skip: asyncs.length === 0 }, function (st) {
st.equal(true, functionsHaveNames, 'functions have names in any env with async functions');
forEach(asyncs, function (asyncFn) {
st.equal(getName(asyncFn), asyncFn.name, 'async function name matches for ' + asyncFn);
});
st.end();
});

Expand Down

0 comments on commit e498133

Please sign in to comment.