Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Nov 2, 2021
1 parent 7692378 commit b127cde
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions eslint/babel-eslint-tests/test/integration/parser-override.js
@@ -1,7 +1,6 @@
import path from "path";
import { fileURLToPath } from "url";
import * as babelESLint from "@babel/eslint-parser";
import * as babelESLintWorker from "@babel/eslint-parser/experimental-worker";

describe("parserOverride", () => {
const expectedAST = {
Expand All @@ -17,6 +16,11 @@ describe("parserOverride", () => {
],
};

const babel7node12 =
process.env.BABEL_8_BREAKING || parseInt(process.versions.node) < 12
? it.skip
: it;

it("works when parsing in the main thread", () => {
const { ast } = babelESLint.parseForESLint(`27`, {
filename: "input.js",
Expand All @@ -31,7 +35,11 @@ describe("parserOverride", () => {
expect(ast).toMatchObject(expectedAST);
});

it("works when parsing in a worker", () => {
babel7node12("works when parsing in a worker", async () => {
const babelESLintWorker = await import(
"@babel/eslint-parser/experimental-worker"
);

const { ast } = babelESLintWorker.parseForESLint(`27`, {
filename: "input.js",
babelOptions: {
Expand Down

0 comments on commit b127cde

Please sign in to comment.