summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorVse Mozhet Byt <vsemozhetbyt@gmail.com>2018-06-25 22:49:45 +0300
committerVse Mozhet Byt <vsemozhetbyt@gmail.com>2018-06-27 23:13:40 +0300
commit759809f67421bdceff9a6799424f5b7d191c458f (patch)
tree31218a7624a05734a670fc1c5263e35863249ceb /test
parent1f6adff12cdf1d1ca6d8def2ef0b5abdff8c45b0 (diff)
downloadandroid-node-v8-759809f67421bdceff9a6799424f5b7d191c458f.tar.gz
android-node-v8-759809f67421bdceff9a6799424f5b7d191c458f.tar.bz2
android-node-v8-759809f67421bdceff9a6799424f5b7d191c458f.zip
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>
Diffstat (limited to 'test')
-rw-r--r--test/doctool/test-make-doc.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/doctool/test-make-doc.js b/test/doctool/test-make-doc.js
index b2bc7a05f6..e019288f75 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');