Yeah that’s the whole “ES modules vs CommonJS” mess. Node is hamstrung by backward compatibility needs. You may get to working by putting “type”: “module” in your package.json, but it’s a bit fiddly. Running your tests with jest may be faster, is the main benefit IMO.
One of the worst bits of JS tbh
Odd. We are currently using Playwright for that; similar syntax. Another alternative is to mix with RTL, which has more the idea of “test it the way it’s used” - works with jest
Comments
It couldn't parse the "import" statements. I was using vanilla javascript.
One of the worst bits of JS tbh
I like Jest, so I'm willing to try again in future