From 5162d9ad0557b0c2acad95d2dc7da645f0732eba Mon Sep 17 00:00:00 2001 From: Trevor Norris Date: Thu, 3 Oct 2024 17:10:32 -0600 Subject: [PATCH] test: fix man page check * The -vv option breaks the test because it expects --vv. So make an exception for that one. * --policies isn't used anymore, so remove it from the man page. --- doc/nsolid.1 | 3 --- test/parallel/test-cli-node-options-docs.js | 6 ++++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/nsolid.1 b/doc/nsolid.1 index 209c698ac7..689ef8ae4a 100644 --- a/doc/nsolid.1 +++ b/doc/nsolid.1 @@ -632,9 +632,6 @@ Print node's version. .\"===================================================================== .Sh N|SOLID OPTIONS .Bl -tag -width 6n -.It Fl -policies Ar file -Activates the requested N|Solid policies as specified in the provided file. -. .It Fl vv Print the N|Solid release version. .El diff --git a/test/parallel/test-cli-node-options-docs.js b/test/parallel/test-cli-node-options-docs.js index 0ac272fc95..03cab594ef 100644 --- a/test/parallel/test-cli-node-options-docs.js +++ b/test/parallel/test-cli-node-options-docs.js @@ -22,7 +22,7 @@ const addOptionRE = /AddOption[\s\n\r]*\([\s\n\r]*"([^"]+)"(.*?)\);/gs; const nodeOptionsText = cliText.match(/(.*)/s)[1]; const v8OptionsText = cliText.match(/(.*)/s)[1]; -const manPage = path.join(rootDir, 'doc', 'node.1'); +const manPage = path.join(rootDir, 'doc', 'nsolid.1'); const manPageText = fs.readFileSync(manPage, { encoding: 'utf8' }); // Documented in /doc/api/deprecations.md @@ -82,7 +82,9 @@ for (const [, envVar, config] of nodeOptionsCC.matchAll(addOptionRE)) { // CLI options if (!isV8Option && !hasTrueAsDefaultValue) { if (new RegExp(`###.*\`${envVar}[[=\\s\\b\`]`).test(cliText) === false) { - assert(false, `Should have option ${envVar} documented`); + if (envVar !== '-vv') { + assert(false, `Should have option ${envVar} documented`); + } } else { manPagesOptions.delete(envVar.slice(1)); }