mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 21:19:50 +01:00
796f3d0af4
PR-URL: https://github.com/nodejs/node/pull/29866 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
22 lines
654 B
JavaScript
22 lines
654 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const { execFileSync } = require('child_process');
|
|
|
|
const entryPoints = ['iDoNotExist', 'iDoNotExist.js', 'iDoNotExist.mjs'];
|
|
const flags = [[], ['--preserve-symlinks']];
|
|
const node = process.argv[0];
|
|
|
|
for (const args of flags) {
|
|
for (const entryPoint of entryPoints) {
|
|
try {
|
|
execFileSync(node, args.concat(entryPoint));
|
|
} catch (e) {
|
|
assert(e.toString().match(/Error: Cannot find module/));
|
|
continue;
|
|
}
|
|
assert.fail('Executing node with inexistent entry point should ' +
|
|
`fail. Entry point: ${entryPoint}, Flags: [${args}]`);
|
|
}
|
|
}
|