summaryrefslogtreecommitdiff
path: root/test/parallel/test-module-loading-error.js
diff options
context:
space:
mode:
authorAli Ijaz Sheikh <ofrobots@google.com>2019-02-13 13:21:10 -0800
committerAli Ijaz Sheikh <ofrobots@google.com>2019-02-15 12:52:05 -0800
commita02e3e2d5f1f96f3c408270d45935afdd5d1fffc (patch)
treea279b109ed4c805a03396a1200fa14f62c6f13e0 /test/parallel/test-module-loading-error.js
parent05cd1a0929441943ba2d90c210c2d8bd8560293f (diff)
downloadnode-new-a02e3e2d5f1f96f3c408270d45935afdd5d1fffc.tar.gz
lib: improve error message for MODULE_NOT_FOUND
Include the require stack in the reported error message. PR-URL: https://github.com/nodejs/node/pull/25690 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-module-loading-error.js')
-rw-r--r--test/parallel/test-module-loading-error.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/parallel/test-module-loading-error.js b/test/parallel/test-module-loading-error.js
index 67dee6a3ba..40b6de72a3 100644
--- a/test/parallel/test-module-loading-error.js
+++ b/test/parallel/test-module-loading-error.js
@@ -80,9 +80,10 @@ common.expectsError(
message: 'The argument \'id\' must be a non-empty string. Received \'\''
});
-common.expectsError(
+assert.throws(
() => { require('../fixtures/packages/is-dir'); },
{
code: 'MODULE_NOT_FOUND',
- message: 'Cannot find module \'../fixtures/packages/is-dir\''
- });
+ message: /Cannot find module '\.\.\/fixtures\/packages\/is-dir'/
+ }
+);