Skip to content

Enhancement: remove workaround for jest's handling of circular structures #11079

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

Open
4 tasks done
43081j opened this issue Apr 15, 2025 · 5 comments
Open
4 tasks done
Labels
blocked by external API Blocked by a tool we depend on exposing an API, such as TypeScript's Type Relationship API enhancement New feature or request

Comments

@43081j
Copy link
Contributor

43081j commented Apr 15, 2025

Before You File a Proposal Please Confirm You Have Done The Following...

Relevant Package

rule-tester

My proposal is suitable for this project

  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Description

// This nonsense is a workaround for https://github.com/jestjs/jest/issues/14840
// see also https://github.com/typescript-eslint/typescript-eslint/issues/8942

It seems jest fixed this on their end now.

We should add a test case to prove this is true and remove the workaround code if it is.

Additional Info

No response

@43081j 43081j added enhancement New feature or request triage Waiting for team members to take a look labels Apr 15, 2025
@kirkwaiblinger
Copy link
Member

It seems jest fixed this on their end now.

From the jest issue, it sounds like not in v29, though, right? And 30 isn't released?

We should add a test case to prove this is true and remove the workaround code if it is.

The motivation for us adding this in the first place was just to be able to develop within the typescript-eslint repo, see #8942. So based on that I'd think we can just remove it, now that we've dropped jest internally (yay!). But I guess it does raise the question whether downstream consumers of the rule tester that use jest would be impacted 🤔

@43081j
Copy link
Contributor Author

43081j commented Apr 15, 2025

that was my thought too. since its in rule tester itself, maybe this also affects some end user somewhere? 😬

i suppose they might get worse errors if they're on older jest?

@kirkwaiblinger
Copy link
Member

Makes sense 👍

they might get worse errors if they're on older jest?

To nitpick - this problem is present in the latest stable release of jest (v29), not older versions. v30 is only available as an alpha. So we definitely can't remove this workaround yet if we're concerned about the impact on downstream jest users.

@kirkwaiblinger
Copy link
Member

I'm not too bothered if we just rip it out anyway, since jest is... jest. But there's no need to bother writing a test then 🤷‍♂

@JoshuaKGoldberg
Copy link
Member

Blurgh yeah I hadn't noticed the fix wasn't released yet. Marking as blocked on Jest 30 going stable.

I don't know how long we'd want to wait after that. A lot of users will be stuck on Jest <30 for a while by the nature of major versions + breaking changes. And even though we just moved to Vitest (whoo!) Jest still has a huge number of users...

@JoshuaKGoldberg JoshuaKGoldberg added blocked by external API Blocked by a tool we depend on exposing an API, such as TypeScript's Type Relationship API and removed triage Waiting for team members to take a look labels Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked by external API Blocked by a tool we depend on exposing an API, such as TypeScript's Type Relationship API enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants