mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
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
d5863bc0f4
PR-URL: https://github.com/nodejs/node/pull/4411
Reviewed-By: Myles Borins <myles.borins@gmail.com>
This commit is contained in:
1 parent
1c5d4f2453
commit
7c9cdb0882
1 file changed
+7
@@ -51,6 +51,12 @@ 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),
|
||||
@@ -58,6 +64,7 @@ function verifyFiles(files, onprogress, ondone) {
|
||||
content: files[name]
|
||||
};
|
||||
});
|
||||
|
||||
files.push({
|
||||
path: path.resolve(dir, 'binding.gyp'),
|
||||
content: JSON.stringify({
|
||||
|
||||
Reference in new issue
Block a user