summaryrefslogtreecommitdiff
path: root/test/doctool/test-make-doc.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/doctool/test-make-doc.js')
-rw-r--r--test/doctool/test-make-doc.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/test/doctool/test-make-doc.js b/test/doctool/test-make-doc.js
index e019288f75..a11da0e97d 100644
--- a/test/doctool/test-make-doc.js
+++ b/test/doctool/test-make-doc.js
@@ -13,17 +13,16 @@ const path = require('path');
const apiPath = path.resolve(__dirname, '..', '..', 'out', 'doc', 'api');
const allDocs = fs.readdirSync(apiPath);
-assert.ok(allDocs.includes('_toc.html'));
+assert.ok(allDocs.includes('index.html'));
const actualDocs = allDocs.filter(
(name) => {
const extension = path.extname(name);
- return (extension === '.html' || extension === '.json') &&
- name !== '_toc.html';
+ return extension === '.html' || extension === '.json';
}
);
-const toc = fs.readFileSync(path.resolve(apiPath, '_toc.html'), 'utf8');
+const toc = fs.readFileSync(path.resolve(apiPath, 'index.html'), 'utf8');
const re = /href="([^/]+\.html)"/;
const globalRe = new RegExp(re, 'g');
const links = toc.match(globalRe);
@@ -32,8 +31,7 @@ assert.notStrictEqual(links, null);
// Filter out duplicate links, leave just filenames, add expected JSON files.
const linkedHtmls = [...new Set(links)].map((link) => link.match(re)[1]);
const expectedJsons = linkedHtmls
- .map((name) => name.replace('.html', '.json'))
- .concat('_toc.json');
+ .map((name) => name.replace('.html', '.json'));
const expectedDocs = linkedHtmls.concat(expectedJsons);
// Test that all the relative links in the TOC match to the actual documents.