We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 83f9604 commit 64a0c80Copy full SHA for 64a0c80
test/es-module/test-esm-loader-search.js
@@ -0,0 +1,18 @@
1
+'use strict';
2
+// Flags: --expose-internals
3
+
4
+// This test ensures that search throws errors appropriately
5
6
+const common = require('../common');
7
8
+const search = require('internal/loader/search');
9
+const errors = require('internal/errors');
10
11
+common.expectsError(
12
+ () => search('target', undefined),
13
+ {
14
+ code: 'ERR_MISSING_MODULE',
15
+ type: errors.Error,
16
+ message: 'Cannot find module target'
17
+ }
18
+);
0 commit comments