@@ -12,6 +12,8 @@ const fs = require('fs');
12
12
const path = require ( 'path' ) ;
13
13
14
14
const apiPath = path . resolve ( __dirname , '..' , '..' , 'out' , 'doc' , 'api' ) ;
15
+ const mdPath = path . resolve ( __dirname , '..' , '..' , 'doc' , 'api' ) ;
16
+ const allMD = fs . readdirSync ( mdPath ) ;
15
17
const allDocs = fs . readdirSync ( apiPath ) ;
16
18
assert . ok ( allDocs . includes ( 'index.html' ) ) ;
17
19
@@ -22,6 +24,15 @@ const actualDocs = allDocs.filter(
22
24
}
23
25
) ;
24
26
27
+ for ( const name of actualDocs ) {
28
+ if ( name . startsWith ( 'all.' ) ) continue ;
29
+
30
+ assert . ok (
31
+ allMD . includes ( name . replace ( / \. \w + $ / , '.md' ) ) ,
32
+ `Unexpected output: out/doc/api/${ name } , remove and rerun.`
33
+ ) ;
34
+ }
35
+
25
36
const toc = fs . readFileSync ( path . resolve ( apiPath , 'index.html' ) , 'utf8' ) ;
26
37
const re = / h r e f = " ( [ ^ / ] + \. h t m l ) " / ;
27
38
const globalRe = new RegExp ( re , 'g' ) ;
@@ -43,7 +54,7 @@ for (const expectedDoc of expectedDocs) {
43
54
// and that they are not empty files.
44
55
for ( const actualDoc of actualDocs ) {
45
56
assert . ok (
46
- expectedDocs . includes ( actualDoc ) , `${ actualDoc } does not not match TOC` ) ;
57
+ expectedDocs . includes ( actualDoc ) , `${ actualDoc } does not match TOC` ) ;
47
58
48
59
assert . ok (
49
60
fs . statSync ( path . join ( apiPath , actualDoc ) ) . size !== 0 ,
0 commit comments