From 223c0e2010964e280af8704605361da2d79da6b5 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 8 Jun 2016 11:15:36 +0200 Subject: [PATCH] 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 Reviewed-By: Sakthipriyan Vairamani --- test/doctool/test-doctool-html.js | 7 +++++++ test/doctool/test-doctool-json.js | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/test/doctool/test-doctool-html.js b/test/doctool/test-doctool-html.js index 91b9e0de6d3777..bd21e21d9563d2 100644 --- a/test/doctool/test-doctool-html.js +++ b/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'); diff --git a/test/doctool/test-doctool-json.js b/test/doctool/test-doctool-json.js index 7b9fbeb019f1e1..520c79bef8bcda 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