Skip to content

Commit 64a0c80

Browse files
clakechevanlucas
authored andcommitted
loader: test search module
PR-URL: #16795 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 83f9604 commit 64a0c80

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
+18
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)