Skip to content

Commit

Permalink
test: test each block in addon.md contains js & cc
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
rvagg authored and Myles Borins committed Feb 15, 2016
1 parent 75b0ea8 commit 305d340
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/doc/addon-verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,20 @@ function once(fn) {
function verifyFiles(files, onprogress, ondone) {
var dir = path.resolve(verifyDir, 'doc-' + id++);

// must have a .cc and a .js to be a valid test
if (!Object.keys(files).some((name) => /\.cc$/.test(name)) ||
!Object.keys(files).some((name) => /\.js$/.test(name))) {
return;
}

files = Object.keys(files).map(function(name) {
return {
path: path.resolve(dir, name),
name: name,
content: files[name]
};
});

files.push({
path: path.resolve(dir, 'binding.gyp'),
content: JSON.stringify({
Expand Down

0 comments on commit 305d340

Please sign in to comment.