summaryrefslogtreecommitdiff
path: root/test/doctool/test-doctool-json.js
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2016-06-08 11:15:36 +0200
committerAnna Henningsen <anna@addaleax.net>2016-07-06 12:33:31 +0200
commitaf273b5e81f1b67758aa47420fbe3f0cf4a26f21 (patch)
tree1881d548ae1eb702798c8c6cf251003f5efb27b1 /test/doctool/test-doctool-json.js
parent1fe0708fd4b9a7a24cfd5cf4d1b095825f4d5b53 (diff)
downloadandroid-node-v8-af273b5e81f1b67758aa47420fbe3f0cf4a26f21.tar.gz
android-node-v8-af273b5e81f1b67758aa47420fbe3f0cf4a26f21.tar.bz2
android-node-v8-af273b5e81f1b67758aa47420fbe3f0cf4a26f21.zip
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>
Diffstat (limited to 'test/doctool/test-doctool-json.js')
-rw-r--r--test/doctool/test-doctool-json.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/doctool/test-doctool-json.js b/test/doctool/test-doctool-json.js
index 7b9fbeb019..520c79bef8 100644
--- a/test/doctool/test-doctool-json.js
+++ b/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