DEV Community

Discussion on: Getting into software testing with Jest

Collapse
 
liviufromendtest profile image
Liviu Lupei

Worth mentioning that Jest will only test your JavaScript.
But don't rely only on Jest.
A real browser is more than just a JavaScript interpreter.

The best practices mention that you should run automated tests in all major browsers, including Safari (which is used by 20% of users, including myself).

A few weeks ago, I wrote a small article:
What Happens When You Don't Test in Safari

Even using clean vanilla code can lead to major cross-browser issues.

Collapse
 
aniket762 profile image
Aniket Pal

You have written a masterpiece, thanks for commenting otherwise I would have missed it. Specially taking Safari as the corner case is genius never actually thought what happens in it.

Collapse
 
zarausto profile image
Fausto

Users can choose the best browser, Safari is becoming the new Internet Explorer, users insist to use it relying on thought about performance/battery and other stuff. Of course performance is important, but new technologies require new behaviors. If you choose Safari you're choosing not to have new technologies. πŸ€·β€β™‚οΈ

Collapse
 
liviufromendtest profile image
Liviu Lupei • Edited

That's how democracy works, and I think it's great that users can choose from a number of browsers that are decent.

You have to test in the browsers used by your users, that's why it's important to get that information from your analytics.

Accessibility means making your website work for as many users as possible.

In some cases, that could mean supporting small screen resolutions or certain browsers.

Now, even if we will live in a totalitarian world where Chrome will be the only browser, you'll still have Chrome on Windows and Chrome on Mac.

Ever noticed that the select elements look different on Chrome on Mac vs. Chrome on Windows?
That's just one of the many differences you'll encounter.

Testing on different browsers can be painful, but it's a best practice, there is no workaround.

Collapse
 
reikrom profile image
Rei Krom

combine with Playwright to do actions and Jest to assert

Collapse
 
liviufromendtest profile image
Liviu Lupei

Some folks are complaining that Playwright, Puppeteer and others are not following any open standards.

That means there's a risk they might stop working out of the blue with certain browsers or other components.

What will happen then?