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: #21531
Fixes: #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 authored and targos committed Jun 28, 2018
1 parent 0f1d737 commit 623cf11
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 623cf11

Please sign in to comment.