diff --git a/test/parallel/test-process-env-allowed-flags-are-documented.js b/test/parallel/test-process-env-allowed-flags-are-documented.js index 64626b71f01902..a2738f08e2fd27 100644 --- a/test/parallel/test-process-env-allowed-flags-are-documented.js +++ b/test/parallel/test-process-env-allowed-flags-are-documented.js @@ -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, '', ''); + // Check the options are documented in alphabetical order. assert.deepStrictEqual(nodeOptionsLines, [...nodeOptionsLines].sort()); assert.deepStrictEqual(v8OptionsLines, [...v8OptionsLines].sort());