diff options
author | Myles Borins <mylesborins@google.com> | 2018-02-15 18:47:10 -0500 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2018-02-16 15:54:56 -0800 |
commit | 1fd69872e6c4d2dd8127560ae078b4cbf8b7badb (patch) | |
tree | e745ed55940dc1c8da3f1bd4cb65e828456c7052 /test/common/index.js | |
parent | 6ab288f3b817197631f23dd858b1b622d80dab27 (diff) | |
download | android-node-v8-1fd69872e6c4d2dd8127560ae078b4cbf8b7badb.tar.gz android-node-v8-1fd69872e6c4d2dd8127560ae078b4cbf8b7badb.tar.bz2 android-node-v8-1fd69872e6c4d2dd8127560ae078b4cbf8b7badb.zip |
test: add common.skipIfEslintMissing
We've added a number of tests that hook into ESLint which can error
when running the test suite with the distributed tarball. This PR
adds a new test helper `common.skipIfEslintMissing` and will skip
remaining tests in a file when `ESLint` is not available at
`tools/node_modules/eslint`
PR-URL: https://github.com/nodejs/node/pull/18807
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'test/common/index.js')
-rw-r--r-- | test/common/index.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/common/index.js b/test/common/index.js index 4c2c548830..a38b985208 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -494,6 +494,14 @@ exports.fileExists = function(pathname) { } }; +exports.skipIfEslintMissing = function() { + if (!exports.fileExists( + path.join('..', '..', 'tools', 'node_modules', 'eslint') + )) { + exports.skip('missing ESLint'); + } +}; + exports.canCreateSymLink = function() { // On Windows, creating symlinks requires admin privileges. // We'll only try to run symlink test if we have enough privileges. |