From b7c7b547ddb7b2c637bf979a0d80fd0cdc9a7f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 1 Oct 2019 22:10:25 +0200 Subject: [PATCH] Skip async/await tests on node 6 --- packages/babel-core/test/async.js | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/packages/babel-core/test/async.js b/packages/babel-core/test/async.js index c5fcbb8f46eb..9fd0919d8658 100644 --- a/packages/babel-core/test/async.js +++ b/packages/babel-core/test/async.js @@ -1,6 +1,12 @@ import path from "path"; import * as babel from ".."; +const nodeGte8 = (...args) => { + // "minNodeVersion": "8.0.0" <-- For Ctrl+F when dropping node 6 + const testFn = process.version.slice(0, 3) === "v6." ? it.skip : it; + testFn(...args); +}; + describe("asynchronicity", () => { const base = path.join(__dirname, "fixtures", "async"); let cwd; @@ -16,7 +22,7 @@ describe("asynchronicity", () => { describe("config file", () => { describe("async function", () => { - it("called synchronously", () => { + nodeGte8("called synchronously", () => { process.chdir("config-file-async-function"); expect(() => @@ -29,7 +35,7 @@ describe("asynchronicity", () => { ); }); - it("called asynchronously", async () => { + nodeGte8("called asynchronously", async () => { process.chdir("config-file-async-function"); await expect( @@ -72,7 +78,7 @@ describe("asynchronicity", () => { }); describe("cache.using", () => { - it("called synchronously", () => { + nodeGte8("called synchronously", () => { process.chdir("config-cache"); expect(() => @@ -85,7 +91,7 @@ describe("asynchronicity", () => { ); }); - it("called asynchronously", async () => { + nodeGte8("called asynchronously", async () => { process.chdir("config-cache"); await expect( @@ -102,7 +108,7 @@ describe("asynchronicity", () => { describe("plugin", () => { describe("factory function", () => { - it("called synchronously", () => { + nodeGte8("called synchronously", () => { process.chdir("plugin"); expect(() => @@ -114,7 +120,7 @@ describe("asynchronicity", () => { ); }); - it("called asynchronously", async () => { + nodeGte8("called asynchronously", async () => { process.chdir("plugin"); await expect( @@ -128,7 +134,7 @@ describe("asynchronicity", () => { }); describe(".pre", () => { - it("called synchronously", () => { + nodeGte8("called synchronously", () => { process.chdir("plugin-pre"); expect(() => @@ -140,7 +146,7 @@ describe("asynchronicity", () => { ); }); - it("called asynchronously", async () => { + nodeGte8("called asynchronously", async () => { process.chdir("plugin-pre"); await expect( @@ -154,7 +160,7 @@ describe("asynchronicity", () => { }); describe(".post", () => { - it("called synchronously", () => { + nodeGte8("called synchronously", () => { process.chdir("plugin-post"); expect(() => @@ -166,7 +172,7 @@ describe("asynchronicity", () => { ); }); - it("called asynchronously", async () => { + nodeGte8("called asynchronously", async () => { process.chdir("plugin-post"); await expect( @@ -180,7 +186,7 @@ describe("asynchronicity", () => { }); describe("inherits", () => { - it("called synchronously", () => { + nodeGte8("called synchronously", () => { process.chdir("plugin-inherits"); expect(() => @@ -192,7 +198,7 @@ describe("asynchronicity", () => { ); }); - it("called asynchronously", async () => { + nodeGte8("called asynchronously", async () => { process.chdir("plugin-inherits"); await expect(