Skip to content

Commit

Permalink
Merge pull request #374 from feross/master
Browse files Browse the repository at this point in the history
Fix spurious "test exited without ending"
  • Loading branch information
ljharb committed Jun 26, 2017
2 parents 1a8e936 + b06f914 commit 51597e2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions bin/tape
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,16 @@ opts.require.forEach(function(module) {
});

opts._.forEach(function (arg) {
glob(arg, function (err, files) {
files.forEach(function (file) {
require(resolvePath(cwd, file));
});
// If glob does not match, `files` will be an empty array.
// Note: `glob.sync` may throw an error and crash the node process.
var files = glob.sync(arg);

if (!Array.isArray(files)) {
throw new TypeError('unknown error: glob.sync did not return an array or throw. Please report this.');
}

files.forEach(function (file) {
require(resolvePath(cwd, file));
});
});

Expand Down

0 comments on commit 51597e2

Please sign in to comment.