-
Notifications
You must be signed in to change notification settings - Fork 11
Jest matcher import is breaking webpack projects. #476
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
Comments
I think this is due to nature of jest itself which is not intended to be used in browser environment. Same goes for this pkg, it is intended to be used as test suite without any bundler support. I am unsure if this can be fixed in viable timeframe as I do not have any env attempt to bundle this pkg. If you have quick fix to suggest, welcome to have PR. |
For what it's worth, I get similar errors for a different angular project. This sample project by Michael Hoffmann using rx-sandbox and Angular 8.0.1 works as expected when running jasmine tests via the browser using karma: If you keep upgrading the angular-cli, you eventually reach a point where it breaks. Specifically, it breaks similarly to the reported issue when you go from:
to:
Looking at the differences between versions, I'm not sure why it starts erroring: |
I was able to narrow down why angular stopped working with rx-sandbox to this commit: where core-js@2 was removed in favor of core-js@3, babel@6 was removed as a dependency, among other changes. |
Another follow-up. The compatibility issues I was having with later versions of angular go away with the recent changes to rx-sandbox that depend on updated versions of the jest libraries, including the switch from jest-matchers to jest's expect package. Perhaps you could release such a version as [email protected] that incorporated all those changes except for the migration to RxJS 7 on a 1.x branch? |
I'll give it a go but can't promise I can do it 100%, there was se rough edges if I recall correctly. |
Here's mine that seems to work. . In my angular 8 project that consumes rx-sandbox, I had to set the value:
|
if you have working changes already, I'd welcome & appreciate PR 😅 |
Want to create a 1.x branch for my PR to target? |
Good point, let me try. |
published 1.0.4. |
The Issue
This project, or one of its dependencies, has an incorrect import path. This causes the test suite to crash whenever the rxSandbox.create() function is called.
The offending import is here: https://github.com/kwonoj/rx-sandbox/blob/master/src/assert/marbleAssert.ts
Steps to reproduce:
Create a new Angular project. Import rxSandbox and call the create() function.
Error Log
The text was updated successfully, but these errors were encountered: