Skip to content

Commit 3f7c503

Browse files
Trotttargos
authored andcommitted
test: adjust CLI flags test to ignore blank lines in doc
PR-URL: #40403 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent adbd92e commit 3f7c503

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

+4-1
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,6 +26,7 @@ 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());

0 commit comments

Comments
 (0)