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

Dynamic rendering blocking #16

Closed
MartinFerret opened this issue Feb 26, 2024 · 7 comments
Closed

Dynamic rendering blocking #16

MartinFerret opened this issue Feb 26, 2024 · 7 comments

Comments

@MartinFerret
Copy link
Contributor

MartinFerret commented Feb 26, 2024

When I run my tests, I'm able to do it when it's simple, like that :

image

When it involves rendering something, I can't get it working, the page tries to load but doesn't, like that :

image

image

I'm integrating it on a project, in Angular 16.

Is there a specific config to handle this or that causes the crash ?

@kolodny
Copy link
Owner

kolodny commented Feb 26, 2024

Usually this is an issue with the bootstrapping code. Your bootstrapping code should look like this. One of the hidden features of SafeTest is you can add #safetest to the url, reload the page, and the console should display all the test files and associated tests. See here for that working in the example angular app.
image

Does that show you all your test files and tests? If not then you probably have something misconfigured in the bootstrapping code.

@MartinFerret
Copy link
Contributor Author

MartinFerret commented Feb 26, 2024

I do have the same config file, I'm comparing what changes between my config and yours, because in the example file it works fine.

When tests with "render" are running, that very error is displayed in console :

image

jest file :

image

setup safetest file :

image

main.ts :

image

Do you have any idea where doest it come from ?

The only difference entre yours and mine, is that mine added npm install safetest.

@kolodny
Copy link
Owner

kolodny commented Feb 26, 2024

That error is a red herring, it's fixed in f57bb0f#diff-81a6613f09b12b04742d8b6ef9524cac4577d91a2440485d0cacace86f489069R60, it just needs to be released.

Everything should work per your config. Can you create a minimal repo that has the issue?

@MartinFerret
Copy link
Contributor Author

MartinFerret commented Feb 26, 2024

Yes of course,I'll post my github link here by tomorrow so you can have a look at it

@MartinFerret
Copy link
Contributor Author

MartinFerret commented Feb 26, 2024

Here it is @kolodny , gave you the rights to access it.

https://github.com/MartinFerret/safetest-error-case

npm install
npx jest

When the browser opens, check in the console and the error appears, also the navigator, obviously, is blocking trying to figure out a way to execute the tests, but gets stuck.

@kolodny
Copy link
Owner

kolodny commented Feb 26, 2024

OK, I see the issue was that windows was using \ while webpack is expecting /. I published a fix in version 0.1.13. Can you let me know if that fixes the issue?

@MartinFerret
Copy link
Contributor Author

Thanks a lot, it resolves the issue on windows !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants