We've just spent the worst couple of hours trying to work with Jest with SVG, nanoid, ... Anything that's slightly out of the ordinary Jest won't work and we found out we were spending more time debugging Jest than debugging our code. So... please help us. How do you survive the testing hell??
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (12)
- Winston Churchill
Does that help you? π
Lol. I'm more tempted of turning around and never testing again!
What languages are you writing and testing in? I've used Jest (barely). Have you tried anything besides Jest? I might have to play around with this...
We're using React. Tried Cypress and the experience is 10000x better. But Cypress is more e2e. I was looking for a unit test and integration test library. Jest is by far one of the most recommended. I really don't know how. It's a pain...
Frontend testing can be hard; but oftentimes when you're having issues writing tests, it's because something is wrong with your code. Poorly designed architectures are hard to test, especially when they stray from the conventions the testing frameworks are designed for.
Frontend testing is... yeah, I understand your pain. I try and make it a habit and do it consistently, so I'm not having to write a whole bunch of tests all at once. But still, I have an entire file that isn't tested because MSW and Vitest simply refuse to cooperate with each other :p
Is there any chance that maybe you are holding it wrong? Try opening a stackoverflow ticket! Personally I have had mostly joy of Jest and not framework specific issues. For my use cases there have been great documentation as well as community posts about all the questions I have been looking for. Mostly, at least.
Check out testing-library, stop testing implementation details like SVGs, maybe really consider switching to vitest.
Testing that's slowing you down is better than writing code with no tests and moving fast.
10/10 times
Simple, just don't write tests.
Have you tried vitest (vitest.dev/)?
IMO the easiest and fastest way to do unit tests :). But if your trying to do sth. very niche, there might only support for it in jestβ¦
Barely used any automated testing in 30 years... and it's never been a problem.