Skip to content

Commit 305d340

Browse files
rvaggMyles Borins
authored and
Myles Borins
committed
test: test each block in addon.md contains js & cc
Allows more freedom in adding additional headings to addon.markdown, otherwise it'll try and convert each block under a heading to a test case. We need to have at least a .js and a .cc in order to have something to test. Fixes regression caused by adding a new 3rd-level heading in d5863bc PR-URL: #4411 Reviewed-By: Myles Borins <[email protected]>
1 parent 75b0ea8 commit 305d340

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tools/doc/addon-verify.js

+7
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,20 @@ function once(fn) {
5151
function verifyFiles(files, onprogress, ondone) {
5252
var dir = path.resolve(verifyDir, 'doc-' + id++);
5353

54+
// must have a .cc and a .js to be a valid test
55+
if (!Object.keys(files).some((name) => /\.cc$/.test(name)) ||
56+
!Object.keys(files).some((name) => /\.js$/.test(name))) {
57+
return;
58+
}
59+
5460
files = Object.keys(files).map(function(name) {
5561
return {
5662
path: path.resolve(dir, name),
5763
name: name,
5864
content: files[name]
5965
};
6066
});
67+
6168
files.push({
6269
path: path.resolve(dir, 'binding.gyp'),
6370
content: JSON.stringify({

0 commit comments

Comments
 (0)