0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00
nodejs/test/es-module/test-esm-loader-search.js
Geoffrey Booth 2551a21553 module: loader getSource, getFormat, transform hooks
PR-URL: https://github.com/nodejs/node/pull/30986
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
2020-01-07 01:31:05 +02:00

21 lines
393 B
JavaScript

'use strict';
// Flags: --expose-internals
// This test ensures that search throws errors appropriately
require('../common');
const assert = require('assert');
const {
defaultResolve: resolve
} = require('internal/modules/esm/resolve');
assert.throws(
() => resolve('target'),
{
code: 'ERR_MODULE_NOT_FOUND',
name: 'Error',
message: /Cannot find package 'target'/
}
);