Skip to content

Commit

Permalink
use error.name for error name duh
Browse files Browse the repository at this point in the history
  • Loading branch information
thymikee committed Jun 6, 2018
1 parent a88e13e commit 90386fc
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/jest-resolve/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,22 +380,20 @@ const createNoMappedModuleFoundError = (
regex,
resolver,
) => {
const error = new Error(
chalk.red(`${chalk.bold('Configuration error')}:
const error = new Error(`
Could not locate module ${chalk.bold(moduleName)} mapped as:
${chalk.bold(updatedName)}).
${chalk.bold(updatedName)}.
Please check your configuration for these entries:
{
"moduleNameMapper": {
"${regex.toString()}": "${chalk.bold(mappedModuleName)}"
},
"resolver": ${chalk.bold(String(resolver))}
}`),
);
}`);

error.name = '';
error.name = chalk.red(`${chalk.bold('Configuration error')}`);

return error;
};
Expand Down

0 comments on commit 90386fc

Please sign in to comment.