From 759809f67421bdceff9a6799424f5b7d191c458f Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Mon, 25 Jun 2018 22:49:45 +0300 Subject: [PATCH] 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 Reviewed-By: Trivikram Kamat Reviewed-By: Gus Caplan --- test/doctool/test-make-doc.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/doctool/test-make-doc.js b/test/doctool/test-make-doc.js index b2bc7a05f6899b..e019288f75cc1e 100644 --- a/test/doctool/test-make-doc.js +++ b/test/doctool/test-make-doc.js @@ -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');