Skip to content

Commit fd8302f

Browse files
addaleaxMyles Borins
authored and
Myles Borins
committed
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 ff005fa commit fd8302f

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

test/doctool/test-doctool-html.js

+7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ const assert = require('assert');
55
const fs = require('fs');
66
const path = 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+
return common.skip('missing js-yaml (eslint not present)');
13+
}
14+
815
const processIncludes = require('../../tools/doc/preprocess.js');
916
const html = require('../../tools/doc/html.js');
1017

test/doctool/test-doctool-json.js

+7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ const assert = require('assert');
55
const fs = require('fs');
66
const path = 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+
return common.skip('missing js-yaml (eslint not present)');
13+
}
14+
815
const json = require('../../tools/doc/json.js');
916

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

0 commit comments

Comments
 (0)