Skip to content

Commit 657fd7a

Browse files
addaleaxevanlucas
authored andcommitted
test: skip doctool tests when js-yaml is missing
Skip the doctool tests when js-yaml, which is currently `require()`d from the eslint source tree, is missing. This can happen, for example, because eslint is not included in the release source tarballs. Fixes: #7201 Ref: #6495 PR-URL: #7218 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
1 parent 0f7b4ef commit 657fd7a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

‎test/doctool/test-doctool-html.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ const assert = require('assert');
55
constfs=require('fs');
66
constpath=require('path');
77

8+
// The doctool currently uses js-yaml from the tool/eslint/ tree.
9+
try{
10+
require('../../tools/eslint/node_modules/js-yaml');
11+
}catch(e){
12+
returncommon.skip('missing js-yaml (eslint not present)');
13+
}
14+
815
constprocessIncludes=require('../../tools/doc/preprocess.js');
916
consthtml=require('../../tools/doc/html.js');
1017

‎test/doctool/test-doctool-json.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ const assert = require('assert');
55
constfs=require('fs');
66
constpath=require('path');
77

8+
// The doctool currently uses js-yaml from the tool/eslint/ tree.
9+
try{
10+
require('../../tools/eslint/node_modules/js-yaml');
11+
}catch(e){
12+
returncommon.skip('missing js-yaml (eslint not present)');
13+
}
14+
815
constjson=require('../../tools/doc/json.js');
916

1017
// Outputs valid json with the expected fields when given simple markdown

0 commit comments

Comments
(0)