Skip to content

Commit

Permalink
test: skip doctool tests when js-yaml is missing
Browse files Browse the repository at this point in the history
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 <me@silverwind.io>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
  • Loading branch information
addaleax authored and evanlucas committed Jul 12, 2016
1 parent 0f7b4ef commit 657fd7a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/doctool/test-doctool-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
7 changes: 7 additions & 0 deletions test/doctool/test-doctool-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 657fd7a

Please sign in to comment.