-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f9379f6
commit 5c69940
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'), | ||
); | ||
}); |