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

Replace Karma (now deprecated) with a new test runner #1038

Open
doeg opened this issue Feb 10, 2024 · 6 comments
Open

Replace Karma (now deprecated) with a new test runner #1038

doeg opened this issue Feb 10, 2024 · 6 comments

Comments

@doeg
Copy link

doeg commented Feb 10, 2024

React Modal uses Karma as its test runner. Karma, however, was deprecated in April 2023.

It looks like the recommended migration is to Jest and Web Test Runner as described here.

@diasbruno noted some caveats specific to React Modal over in #1036:

I thought of moving the test system to jest, but we need to run on the browser as we have a few trick bits to have more reliable tests (to detect hidden node and other things).

If we do move to SWC (as proposed in #1036) and Jest, it's worth noting that SWC has a drop-in replacement that's supposedly much faster than Jest. Given that this repo is fairly small, it may not be super relevant to us... but good to know nonetheless!

@doeg
Copy link
Author

doeg commented Feb 10, 2024

Another thing worth mentioning is that Assitiv Labs, which offers comprehensive and accessibility-focused end-to-end testing, is free for open source projects. I've had really good experiences working with them. :)

I don't think this would be a replacement for unit tests with Jest (or whichever Karma alternative we go with) so I won't go into too much detail on this issue... but I did want to mention it!

@diasbruno
Copy link
Collaborator

jsdom (used by jest) is ok for basic simulations of DOM and rendering, but it's better to use a real browser.

I guess any test runner that can run on the browser is fine.

@doeg
Copy link
Author

doeg commented Feb 10, 2024

@diasbruno it looks like Web Test Runner, which is recommended (by that Angular post above) for migration off of Karma (along with Jest for unit tests, presumably), supports real browsers: https://modern-web.dev/docs/test-runner/browser-launchers/overview/

Perhaps that would be the best place to start, and if/when a need for Jest presents itself, then we can add it to the testing tooclhain. :)

@diasbruno
Copy link
Collaborator

I was trying to get "jasmine-browser-runner" to work, but I was also giving up on it.
I'll check it out.

@doeg
Copy link
Author

doeg commented Feb 11, 2024

@diasbruno let me know if I can do anything to be helpful! ☺️

@diasbruno
Copy link
Collaborator

Before we tackle this, we (I mean I) need to finish the build system.
I did some progress on that, only need to build the pre-compiled lib and the examples.

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