Skip to content

Commit

Permalink
fixup! cli: generate man-page
Browse files Browse the repository at this point in the history
  • Loading branch information
RedYetiDev committed Oct 23, 2024
1 parent f9379f6 commit 5c69940
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/internet/test-man-page-generated.js
Original file line number Diff line number Diff line change
@@ -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'),
);
});

0 comments on commit 5c69940

Please sign in to comment.