0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 21:19:50 +01:00
nodejs/test/parallel/test-module-main-preserve-symlinks-fail.js
Guy Bedford 796f3d0af4
esm: unflag --experimental-modules
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>
2019-11-12 14:04:55 -08:00

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}]`);
}
}