nasa / openmct

A web based mission control framework.
https://nasa.github.io/openmct/
Other
11.99k stars 1.24k forks source link

[Test] Move from Karma to Jest #7329

Open LeoDog896 opened 8 months ago

LeoDog896 commented 8 months ago

Summary

Karma is deprecated and heavily recommends either Vitest or Jest. However, as mentioned before, Vitest isn't quite popular compared to Jest, and Jest does have better ESM support (which can help with implementing #6591 later on).

Plus, if Vitest (somehow) becomes the preferred testing framework, Vitest is primarily compatible with Jest anyway.

unlikelyzero commented 8 months ago

@LeoDog896 I didn't realize that Karma had been formally deprecated. Looks like the EOL will be some time in 2024.

LeoDog896 commented 8 months ago

I would have said that https://github.com/skovhus/jest-codemods would make the most sense as a migration guide, but in the era of chatgpt, I'm not sure if that's the case.

Yep! Used jest-codemods as my first attempt in migrating it (it did well, and I was left with I think only 50 ish manual transformations). However, Jest doesn't like webpack's css/html imports (this is fixable), and Jest especially doesn't like usage of import in a non type: module package. That's the secondary reason as to why I made #7330 and #7331