loader: test search module
PR-URL: https://github.com/nodejs/node/pull/16795 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
3fe165ace6
commit
e0113ab5e0
18
test/es-module/test-esm-loader-search.js
Normal file
18
test/es-module/test-esm-loader-search.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
'use strict';
|
||||||
|
// Flags: --expose-internals
|
||||||
|
|
||||||
|
// This test ensures that search throws errors appropriately
|
||||||
|
|
||||||
|
const common = require('../common');
|
||||||
|
|
||||||
|
const search = require('internal/loader/search');
|
||||||
|
const errors = require('internal/errors');
|
||||||
|
|
||||||
|
common.expectsError(
|
||||||
|
() => search('target', undefined),
|
||||||
|
{
|
||||||
|
code: 'ERR_MISSING_MODULE',
|
||||||
|
type: errors.Error,
|
||||||
|
message: 'Cannot find module target'
|
||||||
|
}
|
||||||
|
);
|
Loading…
x
Reference in New Issue
Block a user