Skip to content

Commit 1ba1c12

Browse files
committed
test: remove experimental-modules
1 parent 2324f1f commit 1ba1c12

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

test/parallel/test-process-env-allowed-flags-are-documented.js

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ const parseSection = (text, startMarker, endMarker) => {
1515
const match = text.match(regExp);
1616
assert(match,
1717
`Unable to locate text between '${startMarker}' and '${endMarker}'.`);
18-
return match[1].split(/\r?\n/);
18+
return match[1]
19+
.split(/\r?\n/)
20+
.filter((val) => val.trim() !== '');
1921
};
2022

2123
const nodeOptionsLines = parseSection(cliText,
@@ -24,28 +26,35 @@ const nodeOptionsLines = parseSection(cliText,
2426
const v8OptionsLines = parseSection(cliText,
2527
'<!-- node-options-v8 start -->',
2628
'<!-- node-options-v8 end -->');
29+
2730
// Check the options are documented in alphabetical order.
2831
assert.deepStrictEqual(nodeOptionsLines, [...nodeOptionsLines].sort());
2932
assert.deepStrictEqual(v8OptionsLines, [...v8OptionsLines].sort());
3033

3134
const documented = new Set();
3235
for (const line of [...nodeOptionsLines, ...v8OptionsLines]) {
3336
for (const match of line.matchAll(/`(-[^`]+)`/g)) {
34-
const option = match[1];
37+
// Remove negation from the option's name.
38+
const option = match[1].replace('--no-', '--');
3539
assert(!documented.has(option),
3640
`Option '${option}' was documented more than once as an ` +
3741
`allowed option for NODE_OPTIONS in ${cliMd}.`);
3842
documented.add(option);
3943
}
4044
}
4145

46+
if (!common.hasOpenSSL3) {
47+
documented.delete('--openssl-legacy-provider');
48+
}
49+
4250
// Filter out options that are conditionally present.
4351
const conditionalOpts = [
4452
{
4553
include: common.hasCrypto,
4654
filter: (opt) => {
4755
return [
4856
'--openssl-config',
57+
common.hasOpenSSL3 ? '--openssl-legacy-provider' : '',
4958
'--tls-cipher-list',
5059
'--use-bundled-ca',
5160
'--use-openssl-ca',
@@ -86,12 +95,25 @@ const undocumented = difference(process.allowedNodeEnvironmentFlags,
8695
documented);
8796
// Remove intentionally undocumented options.
8897
assert(undocumented.delete('--debug-arraybuffer-allocations'));
98+
assert(undocumented.delete('--no-debug-arraybuffer-allocations'));
8999
assert(undocumented.delete('--es-module-specifier-resolution'));
90100
assert(undocumented.delete('--experimental-report'));
91101
assert(undocumented.delete('--experimental-worker'));
102+
assert(undocumented.delete('--node-snapshot'));
92103
assert(undocumented.delete('--no-node-snapshot'));
93104
assert(undocumented.delete('--loader'));
94105
assert(undocumented.delete('--verify-base-objects'));
106+
assert(undocumented.delete('--no-verify-base-objects'));
107+
assert(undocumented.delete('--experimental-modules'));
108+
109+
110+
// Remove negated versions of the flags.
111+
for (const flag of undocumented) {
112+
if (flag.startsWith('--no-')) {
113+
assert(documented.has(`--${flag.slice(5)}`), flag);
114+
undocumented.delete(flag);
115+
}
116+
}
95117

96118
assert.strictEqual(undocumented.size, 0,
97119
'The following options are not documented as allowed in ' +

0 commit comments

Comments
 (0)