summaryrefslogtreecommitdiff
path: root/test/doctool
diff options
context:
space:
mode:
authorVse Mozhet Byt <vsemozhetbyt@gmail.com>2017-07-01 02:29:09 +0300
committerVse Mozhet Byt <vsemozhetbyt@gmail.com>2017-07-04 12:41:49 +0300
commit2d2986ae72f2f5c63d95a94f05fa996d9f0609f1 (patch)
tree7a92ba45eb1ec041a2f9e40b0e63ac5c0be409c0 /test/doctool
parentcc1a47dc6b94b2feb4de9e46be9333d81d537783 (diff)
downloadnode-new-2d2986ae72f2f5c63d95a94f05fa996d9f0609f1.tar.gz
test: simplify test skipping
* Make common.skip() exit. Also add common.printSkipMessage() for partial skips. * Don't make needless things before skip PR-URL: https://github.com/nodejs/node/pull/14021 Fixes: https://github.com/nodejs/node/issues/14016 Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'test/doctool')
-rw-r--r--test/doctool/test-doctool-html.js9
-rw-r--r--test/doctool/test-doctool-json.js9
2 files changed, 8 insertions, 10 deletions
diff --git a/test/doctool/test-doctool-html.js b/test/doctool/test-doctool-html.js
index 3af5a5409d..64f1d7f8b1 100644
--- a/test/doctool/test-doctool-html.js
+++ b/test/doctool/test-doctool-html.js
@@ -1,17 +1,16 @@
'use strict';
const common = require('../common');
-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)');
+ common.skip('missing js-yaml (eslint not present)');
}
+const assert = require('assert');
+const fs = require('fs');
+const path = require('path');
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 346a7f331e..4a4d3a895c 100644
--- a/test/doctool/test-doctool-json.js
+++ b/test/doctool/test-doctool-json.js
@@ -1,17 +1,16 @@
'use strict';
const common = require('../common');
-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)');
+ common.skip('missing js-yaml (eslint not present)');
}
+const assert = require('assert');
+const fs = require('fs');
+const path = require('path');
const json = require('../../tools/doc/json.js');
// Outputs valid json with the expected fields when given simple markdown