-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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]: expect
library vite
support
#14428
Comments
Do you have a full reproduction? Somewhat surprised vite is unable to analyze the import. |
I tried to create a minimum reproduction example here: https://github.com/kkimdev/expect-vite-reproduce/tree/main steps:
The above example is a fresh project using |
Interesting it tries to do some fs stuff...
|
That would be really great! expect is our assertion library of choice, and would love to use in more places! |
I added a vite plugin Because it's the |
I guess this issue is not really specific to Vite since some of the errors are due to node library usages. |
I think ideally |
Yes, I agree. But currently Jest still needs some additional work to implement. It may include adding another bundler tool to satisfy it can be used in a browser environment. this needs some investigation. And this maybe added in Jest v30? @SimenB |
I'd love to see #12348 picked up. Can start with the more reusable modules (like |
Cool~ Is there any plans for this PR? |
PR welcome 🙂 |
Ok, I will do it later. Currently I am ready for IELTS Test. 🥶 |
With the node polyfills linked above, I only need to fix the |
This is great, thanks! btw, how about having a node module shim layer that uses node module if available, or falling back to browser polyfill. In this way, it's no longer dependent on build time transformation. e.g.,
It looks like vite-plugin-node-polyfills is using https://github.com/niksy/node-stdlib-browser underneath . |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🚀 Feature Proposal
Currently
expect
library is unusable withvite
:Motivation
Both
vite
andexpect
are popular libraries. We useexpect
on our server side codebase, but can't on client side due to this issue.Example
No response
Pitch
Because it's a fundamental limitation of
expect
codebase.The text was updated successfully, but these errors were encountered: