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:
Cyril Lakech 2017-11-06 10:34:28 +00:00 committed by James M Snell
parent 3fe165ace6
commit e0113ab5e0

View 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'
}
);