From 28c52f60f6c93de4b1622e2d79f92cfc5bfa2e1c Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 7 Dec 2021 02:01:36 -0800 Subject: [PATCH] test: skip ESLint tests if no Intl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ESLint dependency now requires Intl because it uses regexp unicode character properties. Fixes: https://github.com/nodejs/node/issues/41102 PR-URL: https://github.com/nodejs/node/pull/41105 Reviewed-By: Luigi Pinca Reviewed-By: Michaƫl Zasso Reviewed-By: Derek Lewis Reviewed-By: Richard Lau Reviewed-By: Ruben Bridgewater --- test/parallel/test-eslint-alphabetize-errors.js | 5 +++-- test/parallel/test-eslint-async-iife-no-unused-result.js | 5 +++-- test/parallel/test-eslint-crypto-check.js | 5 +++-- test/parallel/test-eslint-documented-errors.js | 5 +++-- test/parallel/test-eslint-duplicate-requires.js | 5 +++-- test/parallel/test-eslint-eslint-check.js | 5 +++-- test/parallel/test-eslint-inspector-check.js | 5 +++-- test/parallel/test-eslint-lowercase-name-for-primitive.js | 5 +++-- test/parallel/test-eslint-no-array-destructuring.js | 5 +++-- test/parallel/test-eslint-no-unescaped-regexp-dot.js | 5 +++-- test/parallel/test-eslint-non-ascii-character.js | 5 +++-- test/parallel/test-eslint-prefer-assert-iferror.js | 5 +++-- test/parallel/test-eslint-prefer-assert-methods.js | 5 +++-- test/parallel/test-eslint-prefer-common-mustnotcall.js | 5 +++-- test/parallel/test-eslint-prefer-common-mustsucceed.js | 5 +++-- test/parallel/test-eslint-prefer-primordials.js | 5 +++-- test/parallel/test-eslint-prefer-util-format-errors.js | 5 +++-- test/parallel/test-eslint-require-common-first.js | 5 +++-- test/parallel/test-eslint-required-modules.js | 5 +++-- 19 files changed, 57 insertions(+), 38 deletions(-) diff --git a/test/parallel/test-eslint-alphabetize-errors.js b/test/parallel/test-eslint-alphabetize-errors.js index df822f27409..770602353a7 100644 --- a/test/parallel/test-eslint-alphabetize-errors.js +++ b/test/parallel/test-eslint-alphabetize-errors.js @@ -1,8 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) - common.skip('missing crypto'); +if ((!common.hasCrypto) || (!common.hasIntl)) { + common.skip('ESLint tests require crypto and Intl'); +} common.skipIfEslintMissing(); const RuleTester = require('../../tools/node_modules/eslint').RuleTester; diff --git a/test/parallel/test-eslint-async-iife-no-unused-result.js b/test/parallel/test-eslint-async-iife-no-unused-result.js index 6e7f60c183b..c462a22ed2b 100644 --- a/test/parallel/test-eslint-async-iife-no-unused-result.js +++ b/test/parallel/test-eslint-async-iife-no-unused-result.js @@ -1,7 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) - common.skip('missing crypto'); +if ((!common.hasCrypto) || (!common.hasIntl)) { + common.skip('ESLint tests require crypto and Intl'); +} common.skipIfEslintMissing(); const RuleTester = require('../../tools/node_modules/eslint').RuleTester; diff --git a/test/parallel/test-eslint-crypto-check.js b/test/parallel/test-eslint-crypto-check.js index 164149131a9..37089371a56 100644 --- a/test/parallel/test-eslint-crypto-check.js +++ b/test/parallel/test-eslint-crypto-check.js @@ -1,8 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) - common.skip('missing crypto'); +if ((!common.hasCrypto) || (!common.hasIntl)) { + common.skip('ESLint tests require crypto and Intl'); +} common.skipIfEslintMissing(); diff --git a/test/parallel/test-eslint-documented-errors.js b/test/parallel/test-eslint-documented-errors.js index e8abd38a983..6999c06986e 100644 --- a/test/parallel/test-eslint-documented-errors.js +++ b/test/parallel/test-eslint-documented-errors.js @@ -1,8 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) - common.skip('missing crypto'); +if ((!common.hasCrypto) || (!common.hasIntl)) { + common.skip('ESLint tests require crypto and Intl'); +} common.skipIfEslintMissing(); const RuleTester = require('../../tools/node_modules/eslint').RuleTester; diff --git a/test/parallel/test-eslint-duplicate-requires.js b/test/parallel/test-eslint-duplicate-requires.js index 5932fac48e0..bbb3be981ae 100644 --- a/test/parallel/test-eslint-duplicate-requires.js +++ b/test/parallel/test-eslint-duplicate-requires.js @@ -1,8 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) - common.skip('missing crypto'); +if ((!common.hasCrypto) || (!common.hasIntl)) { + common.skip('ESLint tests require crypto and Intl'); +} common.skipIfEslintMissing(); diff --git a/test/parallel/test-eslint-eslint-check.js b/test/parallel/test-eslint-eslint-check.js index 28ec2e1f10f..3e0162bf2cd 100644 --- a/test/parallel/test-eslint-eslint-check.js +++ b/test/parallel/test-eslint-eslint-check.js @@ -1,8 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) - common.skip('missing crypto'); +if ((!common.hasCrypto) || (!common.hasIntl)) { + common.skip('ESLint tests require crypto and Intl'); +} common.skipIfEslintMissing(); diff --git a/test/parallel/test-eslint-inspector-check.js b/test/parallel/test-eslint-inspector-check.js index 2d945c3da33..e6969e80eef 100644 --- a/test/parallel/test-eslint-inspector-check.js +++ b/test/parallel/test-eslint-inspector-check.js @@ -1,8 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) - common.skip('missing crypto'); +if ((!common.hasCrypto) || (!common.hasIntl)) { + common.skip('ESLint tests require crypto and Intl'); +} common.skipIfEslintMissing(); const RuleTester = require('../../tools/node_modules/eslint').RuleTester; diff --git a/test/parallel/test-eslint-lowercase-name-for-primitive.js b/test/parallel/test-eslint-lowercase-name-for-primitive.js index 11cba8f3f8e..24b42001a4a 100644 --- a/test/parallel/test-eslint-lowercase-name-for-primitive.js +++ b/test/parallel/test-eslint-lowercase-name-for-primitive.js @@ -1,8 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) - common.skip('missing crypto'); +if ((!common.hasCrypto) || (!common.hasIntl)) { + common.skip('ESLint tests require crypto and Intl'); +} common.skipIfEslintMissing(); diff --git a/test/parallel/test-eslint-no-array-destructuring.js b/test/parallel/test-eslint-no-array-destructuring.js index be59ee69309..d26e32a03e6 100644 --- a/test/parallel/test-eslint-no-array-destructuring.js +++ b/test/parallel/test-eslint-no-array-destructuring.js @@ -1,8 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) - common.skip('missing crypto'); +if ((!common.hasCrypto) || (!common.hasIntl)) { + common.skip('ESLint tests require crypto and Intl'); +} common.skipIfEslintMissing(); diff --git a/test/parallel/test-eslint-no-unescaped-regexp-dot.js b/test/parallel/test-eslint-no-unescaped-regexp-dot.js index 7cf69877ca1..1443c6f862c 100644 --- a/test/parallel/test-eslint-no-unescaped-regexp-dot.js +++ b/test/parallel/test-eslint-no-unescaped-regexp-dot.js @@ -1,8 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) - common.skip('missing crypto'); +if ((!common.hasCrypto) || (!common.hasIntl)) { + common.skip('ESLint tests require crypto and Intl'); +} common.skipIfEslintMissing(); diff --git a/test/parallel/test-eslint-non-ascii-character.js b/test/parallel/test-eslint-non-ascii-character.js index 0b4a09f8134..d1e3b0227ee 100644 --- a/test/parallel/test-eslint-non-ascii-character.js +++ b/test/parallel/test-eslint-non-ascii-character.js @@ -1,8 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) - common.skip('missing crypto'); +if ((!common.hasCrypto) || (!common.hasIntl)) { + common.skip('ESLint tests require crypto and Intl'); +} common.skipIfEslintMissing(); diff --git a/test/parallel/test-eslint-prefer-assert-iferror.js b/test/parallel/test-eslint-prefer-assert-iferror.js index 5ccb7883393..2bbcc9021b6 100644 --- a/test/parallel/test-eslint-prefer-assert-iferror.js +++ b/test/parallel/test-eslint-prefer-assert-iferror.js @@ -1,8 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) - common.skip('missing crypto'); +if ((!common.hasCrypto) || (!common.hasIntl)) { + common.skip('ESLint tests require crypto and Intl'); +} common.skipIfEslintMissing(); diff --git a/test/parallel/test-eslint-prefer-assert-methods.js b/test/parallel/test-eslint-prefer-assert-methods.js index 3271f6ab185..91380364b18 100644 --- a/test/parallel/test-eslint-prefer-assert-methods.js +++ b/test/parallel/test-eslint-prefer-assert-methods.js @@ -1,8 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) - common.skip('missing crypto'); +if ((!common.hasCrypto) || (!common.hasIntl)) { + common.skip('ESLint tests require crypto and Intl'); +} common.skipIfEslintMissing(); diff --git a/test/parallel/test-eslint-prefer-common-mustnotcall.js b/test/parallel/test-eslint-prefer-common-mustnotcall.js index 5c360bb1ecb..d6796b504c1 100644 --- a/test/parallel/test-eslint-prefer-common-mustnotcall.js +++ b/test/parallel/test-eslint-prefer-common-mustnotcall.js @@ -1,8 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) - common.skip('missing crypto'); +if ((!common.hasCrypto) || (!common.hasIntl)) { + common.skip('ESLint tests require crypto and Intl'); +} common.skipIfEslintMissing(); diff --git a/test/parallel/test-eslint-prefer-common-mustsucceed.js b/test/parallel/test-eslint-prefer-common-mustsucceed.js index 302b6a0bee4..9b47a350e92 100644 --- a/test/parallel/test-eslint-prefer-common-mustsucceed.js +++ b/test/parallel/test-eslint-prefer-common-mustsucceed.js @@ -1,8 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) - common.skip('missing crypto'); +if ((!common.hasCrypto) || (!common.hasIntl)) { + common.skip('ESLint tests require crypto and Intl'); +} common.skipIfEslintMissing(); diff --git a/test/parallel/test-eslint-prefer-primordials.js b/test/parallel/test-eslint-prefer-primordials.js index aa7f1940675..61b6b632727 100644 --- a/test/parallel/test-eslint-prefer-primordials.js +++ b/test/parallel/test-eslint-prefer-primordials.js @@ -1,8 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) - common.skip('missing crypto'); +if ((!common.hasCrypto) || (!common.hasIntl)) { + common.skip('ESLint tests require crypto and Intl'); +} common.skipIfEslintMissing(); diff --git a/test/parallel/test-eslint-prefer-util-format-errors.js b/test/parallel/test-eslint-prefer-util-format-errors.js index a6c2662a382..8a717f0da1f 100644 --- a/test/parallel/test-eslint-prefer-util-format-errors.js +++ b/test/parallel/test-eslint-prefer-util-format-errors.js @@ -3,8 +3,9 @@ /* eslint-disable no-template-curly-in-string */ const common = require('../common'); -if (!common.hasCrypto) - common.skip('missing crypto'); +if ((!common.hasCrypto) || (!common.hasIntl)) { + common.skip('ESLint tests require crypto and Intl'); +} common.skipIfEslintMissing(); diff --git a/test/parallel/test-eslint-require-common-first.js b/test/parallel/test-eslint-require-common-first.js index b3d132e11fd..83fbbba72c3 100644 --- a/test/parallel/test-eslint-require-common-first.js +++ b/test/parallel/test-eslint-require-common-first.js @@ -1,8 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) - common.skip('missing crypto'); +if ((!common.hasCrypto) || (!common.hasIntl)) { + common.skip('ESLint tests require crypto and Intl'); +} common.skipIfEslintMissing(); diff --git a/test/parallel/test-eslint-required-modules.js b/test/parallel/test-eslint-required-modules.js index c891e235071..a27409c0f9e 100644 --- a/test/parallel/test-eslint-required-modules.js +++ b/test/parallel/test-eslint-required-modules.js @@ -1,8 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) - common.skip('missing crypto'); +if ((!common.hasCrypto) || (!common.hasIntl)) { + common.skip('ESLint tests require crypto and Intl'); +} common.skipIfEslintMissing();