Skip to content

Commit

Permalink
test: skip non-doc files in test-make-doc checks
Browse files Browse the repository at this point in the history
PR-URL: nodejs#21531
Fixes: nodejs#21519
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
  • Loading branch information
vsemozhetbyt committed Jun 27, 2018
1 parent 1f6adff commit 759809f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/doctool/test-make-doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 759809f

Please sign in to comment.