test: skip non-doc files in test-make-doc checks
PR-URL: https://github.com/nodejs/node/pull/21531 Fixes: https://github.com/nodejs/node/issues/21519 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
This commit is contained in:
parent
1f6adff12c
commit
759809f674
@ -15,9 +15,12 @@ const apiPath = path.resolve(__dirname, '..', '..', 'out', 'doc', 'api');
|
||||
const allDocs = fs.readdirSync(apiPath);
|
||||
assert.ok(allDocs.includes('_toc.html'));
|
||||
|
||||
const filter = ['assets', '_toc.html', '.md'];
|
||||
const actualDocs = allDocs.filter(
|
||||
(name) => !filter.some((str) => name.includes(str))
|
||||
(name) => {
|
||||
const extension = path.extname(name);
|
||||
return (extension === '.html' || extension === '.json') &&
|
||||
name !== '_toc.html';
|
||||
}
|
||||
);
|
||||
|
||||
const toc = fs.readFileSync(path.resolve(apiPath, '_toc.html'), 'utf8');
|
||||
|
Loading…
x
Reference in New Issue
Block a user