Browse Source

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: https://github.com/nodejs/node/issues/7201
Ref: https://github.com/nodejs/node/pull/6495
PR-URL: https://github.com/nodejs/node/pull/7218
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
v6.x
Anna Henningsen 9 years ago
committed by Evan Lucas
parent
commit
657fd7aee9
  1. 7
      test/doctool/test-doctool-html.js
  2. 7
      test/doctool/test-doctool-json.js

7
test/doctool/test-doctool-html.js

@ -5,6 +5,13 @@ const assert = require('assert');
const fs = require('fs');
const path = require('path');
// The doctool currently uses js-yaml from the tool/eslint/ tree.
try {
require('../../tools/eslint/node_modules/js-yaml');
} catch (e) {
return common.skip('missing js-yaml (eslint not present)');
}
const processIncludes = require('../../tools/doc/preprocess.js');
const html = require('../../tools/doc/html.js');

7
test/doctool/test-doctool-json.js

@ -5,6 +5,13 @@ const assert = require('assert');
const fs = require('fs');
const path = require('path');
// The doctool currently uses js-yaml from the tool/eslint/ tree.
try {
require('../../tools/eslint/node_modules/js-yaml');
} catch (e) {
return common.skip('missing js-yaml (eslint not present)');
}
const json = require('../../tools/doc/json.js');
// Outputs valid json with the expected fields when given simple markdown

Loading…
Cancel
Save