Content-Length: 338757 | pFad | http://github.com/babel/babel/pull/15902/commits/286b981e8a280536e079ab0936e976dc369ea2b4

CE extract more test helpers to repo-utils by JLHwung · Pull Request #15902 · babel/babel · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extract more test helpers to repo-utils #15902

Merged
merged 8 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add itDummy
  • Loading branch information
JLHwung committed Aug 28, 2023
commit 286b981e8a280536e079ab0936e976dc369ea2b4
8 changes: 4 additions & 4 deletions eslint/babel-eslint-parser/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { fileURLToPath } from "url";
import { createRequire } from "module";
import { parseForESLint as parseForESLintOriginal } from "../lib/index.cjs";
import { ESLint } from "eslint";
import { itDummy } from "$repo-utils";

function parseForESLint(code, options) {
return parseForESLintOriginal(code, {
Expand All @@ -22,10 +23,9 @@ const isESLint7 = ESLINT_VERSION.startsWith("7.");
const dirname = path.dirname(fileURLToPath(import.meta.url));

// @babel/eslint-parser 8 will drop ESLint 7 support
const dummy = () => {};
dummy.skip = dummy.only = dummy;
const itESLint7 = isESLint7 && !process.env.BABEL_8_BREAKING ? it : dummy;
const itESLint8 = isESLint7 ? dummy : it;

const itESLint7 = isESLint7 && !process.env.BABEL_8_BREAKING ? it : itDummy;
const itESLint8 = isESLint7 ? itDummy : it;

const BABEL_OPTIONS = {
configFile: path.resolve(
Expand Down
2 changes: 2 additions & 0 deletions scripts/repo-utils/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ exports.USE_ESM = USE_ESM;

if (typeof jest !== "undefined") {
const dummy = () => {};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here.

dummy.only = dummy.skip = dummy;
exports.itDummy = dummy;
exports.itNoESM = USE_ESM ? dummy : it;
exports.itESM = USE_ESM ? it : dummy;
exports.itGteESM = function (version) {
Expand Down
1 change: 1 addition & 0 deletions scripts/repo-utils/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ export const itNoWin32: jest.It;
export const itBabel8: jest.It;
export const itBabel7: jest.It;
export const itBabel7NoESM: jest.It;
export const itDummy: jest.It;
export const describeBabel7: jest.Describe;
export const describeBabel8: jest.Describe;








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/babel/babel/pull/15902/commits/286b981e8a280536e079ab0936e976dc369ea2b4

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy