Skip to content

Commit

Permalink
use robuster feature checks in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop committed Mar 7, 2020
1 parent 4f03fbf commit 5dd4308
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
},
"devDependencies": {
"airtap": "^1.0.0",
"functions-have-names": "^1.2.1",
"has-symbols": "^1.0.1",
"isarray": "^2.0.2",
"tape": "^4.8.0"
},
Expand Down
6 changes: 4 additions & 2 deletions tests/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
var test = require('tape');
var functionsHaveNames = require('functions-have-names');
var hasSymbols = require('has-symbols');

require('./legacy-compat');
var common = require('./common');
Expand All @@ -25,7 +27,7 @@ require('./listener-count.js');
require('./listeners-side-effects.js');
require('./listeners.js');
require('./max-listeners.js');
if ((function A () {}).name === 'A') {
if (functionsHaveNames()) {
require('./method-names.js');
} else {
// Function.name is not supported in IE
Expand All @@ -38,7 +40,7 @@ require('./prepend.js');
require('./set-max-listeners-side-effects.js');
require('./special-event-names.js');
require('./subclass.js');
if (typeof Symbol === 'function') {
if (hasSymbols()) {
require('./symbols.js');
} else {
// Symbol is not available.
Expand Down

0 comments on commit 5dd4308

Please sign in to comment.