Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
replace \ns with platform independeny EOLs
  • Loading branch information
dario-piotrowicz committed Jun 29, 2025
commit 8f55596de92ac0df7957947b924039c40e8e4264
11 changes: 6 additions & 5 deletions test/parallel/test-cli-node-cli-manpage-options.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import '../common/index.mjs';
import assert from 'assert';
import assert from 'node:assert';
import { createReadStream, readFileSync } from 'node:fs';
import { createInterface } from 'node:readline';
import { resolve, join } from 'node:path';
import { EOL } from "node:os";

Check failure on line 6 in test/parallel/test-cli-node-cli-manpage-options.mjs

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Strings must use singlequote

// This test checks that all the CLI flags defined in the public CLI documentation (doc/api/cli.md)
// are also documented in the manpage file (doc/node.1)
Expand Down Expand Up @@ -83,15 +84,15 @@

if (insideOptionsSection && isOptionLineRegex.test(line)) {
if (line === '### `-`') {
if (!manPageContents.includes('\n.It Sy -\n')) {
if (!manPageContents.includes(`${EOL}.It Sy -${EOL}`)) {
throw new Error(`The \`-\` flag is missing in the \`doc/node.1\` file`);
}
optionsEncountered.dash++;
continue;
}

if (line === '### `--`') {
if (!manPageContents.includes('\n.It Fl -\n')) {
if (!manPageContents.includes(`${EOL}.It Fl -${EOL}`)) {
throw new Error(`The \`--\` flag is missing in the \`doc/node.1\` file`);
}
optionsEncountered.dashDash++;
Expand All @@ -107,9 +108,9 @@
.join(' , ')}`;

if (
// Note: we don't check the full line (note the `\n` only at the beginning) because
// Note: we don't check the full line (note the EOL only at the beginning) because
// options can have arguments and we do want to ignore those
!manPageContents.includes(`\n${manLine}`) &&
!manPageContents.includes(`${EOL}${manLine}`) &&
!flagNames.every((flag) => knownFlagsMissingFromManPage.has(flag))) {
assert.fail(
`The following flag${
Expand Down
Loading