mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
d859e9e997
PR-URL: https://github.com/nodejs/node/pull/42623 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
22 lines
652 B
JavaScript
22 lines
652 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const { execFileSync } = require('child_process');
|
|
|
|
const entryPoints = ['iDoNotExist', 'iDoNotExist.js', 'iDoNotExist.mjs'];
|
|
const node = process.argv[0];
|
|
|
|
for (const entryPoint of entryPoints) {
|
|
try {
|
|
execFileSync(node, [entryPoint], { stdio: 'pipe' });
|
|
} catch (e) {
|
|
const error = e.toString();
|
|
assert.match(error, /MODULE_NOT_FOUND/);
|
|
assert.match(error, /Cannot find module/);
|
|
assert(error.includes(entryPoint));
|
|
continue;
|
|
}
|
|
assert.fail('Executing node with inexistent entry point should ' +
|
|
`fail. Entry point: ${entryPoint}`);
|
|
}
|