Skip to content

Commit

Permalink
Replace type() -> typeof
Browse files Browse the repository at this point in the history
Add truthy check to handle null edge case

type(ES Module) => "module", but we treat it the same as an object
  • Loading branch information
JacobLey committed May 28, 2020
1 parent ebc2a07 commit c411c30
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/cli/run-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ exports.handleRequires = async (requires = []) => {
}
const requiredModule = await requireOrImport(modpath);
if (
['object', 'module'].includes(type(requiredModule)) &&
requiredModule &&
typeof requiredModule === 'object' &&
requiredModule.mochaHooks
) {
const mochaHooksType = type(requiredModule.mochaHooks);
Expand Down
Empty file.

0 comments on commit c411c30

Please sign in to comment.