-
Notifications
You must be signed in to change notification settings - Fork 237
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
Feature Request: Make this plugin work with bun #1431
Comments
I don't wanna hard code in A caveat is that there's no guarantee the semantics this plugin assumes holds when using |
what the bun test runner does is trying to be a drop-in replacement for jest & vitest; so even if you have an import from
thank you, I'll try to take a stab it at. Am I assuming correctly that |
I'm not too thrilled about this because we're meant to be just for Jest but I guess supporting a setting for it wouldn't hurt though
Doesn't that mean you can just import from I'd also be interested in hearing from @JoshuaKGoldberg on if this would help with #1289 - my understanding is vitest is also meant to be a drop-in replacement for Jest so in theory this new setting should help but they're already reported that not all rules are 1:1 compatible |
Yes, you can, but then we'd need an additional dependency on the suggested
I can totally live with the patch we have right now, so let's take the time to settle on the right solution before introducing a new api :) |
Yeah that'd be great 😄 but for the mentioned caveats that the various testing libraries are all at least a little different from each other. Maybe it'd be useful to have a big comparison table of all the differences & similarities? (not volunteering myself, sorry) |
I have no interest in maintaining a comparison table (or changing default behaviour). But an option to allow people to mix and match seems fine as long as we state no compat promises are made |
🎉 This issue has been resolved in version 28.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
bun had a 1.0 release recently, and a lot of things from its test runner work like jest. Mostly, it's a drop-in replacement to do:
however, changing the import like that makes the
eslint-plugin-jest
no longer work, because the rules only apply to imports from'@jest/globals'
, as we can see here:eslint-plugin-jest/src/rules/utils/parseJestFnCall.ts
Lines 567 to 569 in 1b96756
We are currently patching this plugin to also detect bun imports by extending this if statement:
I'd be happy to hear your thoughts on making this work either out of the box, or making it configurable. I'm also up for contributing a PR.
Thanks 🙏
The text was updated successfully, but these errors were encountered: