Prepare codebase for inline Babel 8 breaking changes (#12440)

This commit is contained in:
Nicolò Ribaudo
2020-12-04 21:30:40 +01:00
committed by GitHub
parent 3bd6a3d781
commit c139d1602b
6 changed files with 99 additions and 10 deletions

View File

@@ -122,7 +122,11 @@ function pushTask(taskName, taskDir, suite, suiteName) {
const test = {
optionsDir: taskOptsLoc ? path.dirname(taskOptsLoc) : null,
title: humanize(taskName, true),
disabled: taskName[0] === ".",
disabled:
taskName[0] === "." ||
(process.env.BABEL_8_BREAKING
? taskOpts.BABEL_8_BREAKING === false
: taskOpts.BABEL_8_BREAKING === true),
options: taskOpts,
validateLogs: taskOpts.validateLogs,
ignoreOutput: taskOpts.ignoreOutput,

View File

@@ -1,7 +1,9 @@
import * as t from "../lib";
describe("regressions", () => {
it("jest .toMatchInlineSnapshot used 'Line' for comments", () => {
const babel7 = process.env.BABEL_TYPES_8_BREAKING ? it.skip : it;
babel7("jest .toMatchInlineSnapshot used 'Line' for comments", () => {
expect(() => {
t.file(t.program([]), [{ type: "Line" }]);
}).not.toThrow();