From 5c69940e78340a0cb2cb9d1f9d264a75007050fa Mon Sep 17 00:00:00 2001 From: RedYetiDev <38299977+RedYetiDev@users.noreply.github.com> Date: Mon, 21 Oct 2024 20:19:15 -0400 Subject: [PATCH] fixup! cli: generate man-page --- test/internet/test-man-page-generated.js | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/internet/test-man-page-generated.js diff --git a/test/internet/test-man-page-generated.js b/test/internet/test-man-page-generated.js new file mode 100644 index 00000000000000..a8ceff479994b0 --- /dev/null +++ b/test/internet/test-man-page-generated.js @@ -0,0 +1,28 @@ +'use strict'; + +const common = require('../common'); +const tmpdir = require('../common/tmpdir'); +const { test } = require('node:test'); +const { readFileSync } = require('node:fs'); +const path = require('node:path'); + +test('Verify that the man-page has been properly generated', async (t) => { + tmpdir.refresh(); + + const root = path.resolve(__dirname, '..', '..'); + const expected = tmpdir.resolve('node.1'); + + await common.spawnPromisified(process.execPath, [ + path.join(root, 'deps', 'npm', 'bin', 'npx-cli.js'), + '--yes', + 'github:nodejs/api-docs-tooling', + '-i', path.join(root, 'doc', 'api', 'cli.md'), + '-o', expected, + '-t', 'man-page', + ]); + + t.assert.strictEqual( + readFileSync(path.join(root, 'doc', 'node.1'), 'utf-8'), + readFileSync(expected, 'utf-8'), + ); +});