Replace Karma (now deprecated) with a new test runner
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 https://github.com/reactjs/react-modal/issues/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 https://github.com/reactjs/react-modal/issues/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!
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!
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.
@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. :)
I was trying to get "jasmine-browser-runner" to work, but I was also giving up on it. I'll check it out.
@diasbruno let me know if I can do anything to be helpful! ☺️
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.