From fefc84099cedc67214a47e464955230c8088d697 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 21 Dec 2021 19:05:05 +0100 Subject: [PATCH] Skip --watch tests on Node.js 6 There is something weird going on with stdin/out streams. --- .../options.json | 3 ++- .../options.json | 3 ++- packages/babel-cli/test/index.js | 9 ++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --watch --verbose with external dependencies/options.json b/packages/babel-cli/test/fixtures/babel/dir --out-dir --watch --verbose with external dependencies/options.json index 974b5e5f42e9..6fc02e90636e 100644 --- a/packages/babel-cli/test/fixtures/babel/dir --out-dir --watch --verbose with external dependencies/options.json +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --watch --verbose with external dependencies/options.json @@ -1,5 +1,6 @@ { "args": ["src", "--out-dir", "lib", "--watch", "--verbose"], "noBabelrc": true, - "noDefaultPlugins": true + "noDefaultPlugins": true, + "minNodeVersion": 8 } diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --watch with external dependencies/options.json b/packages/babel-cli/test/fixtures/babel/dir --out-dir --watch with external dependencies/options.json index 7119bd39a21b..290c3dcabb24 100644 --- a/packages/babel-cli/test/fixtures/babel/dir --out-dir --watch with external dependencies/options.json +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --watch with external dependencies/options.json @@ -1,5 +1,6 @@ { "args": ["src", "--out-dir", "lib", "--watch"], "noBabelrc": true, - "noDefaultPlugins": true + "noDefaultPlugins": true, + "minNodeVersion": 8 } diff --git a/packages/babel-cli/test/index.js b/packages/babel-cli/test/index.js index 6251fd33ffd6..1941b84cf81d 100644 --- a/packages/babel-cli/test/index.js +++ b/packages/babel-cli/test/index.js @@ -282,8 +282,15 @@ fs.readdirSync(fixtureLoc).forEach(function (binName) { // copy .babelignore file to tmp directory opts.inFiles[".babelignore"] = helper.readFile(babelIgnoreLoc); } + + const skip = + opts.minNodeVersion && + parseInt(process.versions.node, 10) < opts.minNodeVersion; + // eslint-disable-next-line jest/valid-title - it(testName, buildTest(binName, testName, opts), 20000); + (skip + ? it.skip + : it)(testName, buildTest(binName, testName, opts), 20000); }); }); });