mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:45:32 -05:00
test: adjust CLI flags test to ignore blank lines in doc
PR-URL: https://github.com/nodejs/node/pull/40403 Backport-PR-URL: https://github.com/nodejs/node/pull/40530 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>
This commit is contained in:
1 parent
8226690097
commit
6de88bc5ed
1 file changed
+4
-1
@@ -15,7 +15,9 @@ const parseSection = (text, startMarker, endMarker) => {
|
||||
const match = text.match(regExp);
|
||||
assert(match,
|
||||
`Unable to locate text between '${startMarker}' and '${endMarker}'.`);
|
||||
return match[1].split(/\r?\n/);
|
||||
return match[1]
|
||||
.split(/\r?\n/)
|
||||
.filter((val) => val.trim() !== '');
|
||||
};
|
||||
|
||||
const nodeOptionsLines = parseSection(cliText,
|
||||
@@ -24,6 +26,7 @@ const nodeOptionsLines = parseSection(cliText,
|
||||
const v8OptionsLines = parseSection(cliText,
|
||||
'<!-- node-options-v8 start -->',
|
||||
'<!-- node-options-v8 end -->');
|
||||
|
||||
// Check the options are documented in alphabetical order.
|
||||
assert.deepStrictEqual(nodeOptionsLines, [...nodeOptionsLines].sort());
|
||||
assert.deepStrictEqual(v8OptionsLines, [...v8OptionsLines].sort());
|
||||
|
||||
Reference in new issue
Block a user