From da5b4966a87a25351bec80a23c9eeca752956ec1 Mon Sep 17 00:00:00 2001 From: Christophe Hurpeau Date: Wed, 22 Feb 2017 01:56:48 +0100 Subject: [PATCH] moduleNotFound: add file where the module is missing --- src/formatters/moduleNotFound.js | 2 +- test/integration.spec.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/formatters/moduleNotFound.js b/src/formatters/moduleNotFound.js index a5f3b9d..11ecb15 100644 --- a/src/formatters/moduleNotFound.js +++ b/src/formatters/moduleNotFound.js @@ -25,7 +25,7 @@ function formatErrors (errors) { return concat( dependenciesNotFound(errors.length), '', - errors.map(e =>`* ${e.module}`), + errors.map(e =>`* ${e.module}${e.file ? ` in ${e.file}` : ''}`), '', forgetToInstall(errors.length) ); diff --git a/test/integration.spec.js b/test/integration.spec.js index c588557..6882a91 100644 --- a/test/integration.spec.js +++ b/test/integration.spec.js @@ -49,8 +49,8 @@ it('integration : module-errors', async() => { '', 'These dependencies were not found in node_modules:', '', - '* ./non-existing', - '* not-found', + '* ./non-existing in ./test/fixtures/module-errors/index.js', + '* not-found in ./test/fixtures/module-errors/index.js', '', 'Did you forget to run npm install --save for them?' ]); @@ -125,8 +125,8 @@ it('integration : webpack multi compiler : module-errors', async() => { '', 'These dependencies were not found in node_modules:', '', - '* ./non-existing', - '* not-found', + '* ./non-existing in ./test/fixtures/multi-compiler-module-errors/index.js', + '* not-found in ./test/fixtures/multi-compiler-module-errors/index2.js', '', 'Did you forget to run npm install --save for them?' ]);