News for hackers. Stuff that matters.
Re:A development process to ship features fast by SkyPuncher on Monday September 12, 2022 @10:29PM (#32820085)
Our team actually dropped our FE testing. After doing it for a year, we basically came to the conclusion it wasn't catching bugs we cared about while costing us loads of time. We still test on the BE.

On the FE, we noticed:

* Most of the bugs were in UX/UI that are very hard to capture in a test suite.

* CSS/UI bugs are better handled with a good UI library. We have an _amazing_ UI dev that's built a really stable UI library for the team.

* It took forever to write FE tests.

* It took even longer to run FE tests.

* Even well-written FE tests miss a lot of subtle issues.

* We rarely had "random" bugs. UI bugs were almost always in the code we changed. Easily detect with quick click testing.

Re:A development process to ship features fast by Gigachad on Monday September 12, 2022 @11:02PM (#32820241)
I have looked in to front end unit tests a bunch and never seen any way to do them that makes sense. Jest and the lot just don’t seem that useful.

What _does_ work is front end integration tests with cypress/selenium. You just write some basic tests that click through the flows and see you got to the end. This catches issues all the time where the api response or something has changed unexpectedly and the UI gets stuck half way on an error.

It’s also super simple, it’s 10 likes of looking up elements by ID and running .click(). They hardly ever break from normal UI changes and prove that the app is mostly working as intended.

Switching to TypeScript is also a big one. It’s almost like half a test system given to you for free.

Re:A development process to ship features fast by abracadabra_ on Tuesday September 13, 2022 @04:44AM (#32821963)
I appreciate your position but I could not disagree with you more. React and other frameworks allow for components to be unit tested very easily, with good control over the inputs. This gives confidence in each component which can then be added to with a (very small) set of end to end tests.

I would also state that "10 likes of looking up elements by ID and running .click()" is a big part of why e2e tests are flaky and hard to maintain. Good e2e tests require good engineering.

Re:A development process to ship features fast by SkyPuncher on Tuesday September 13, 2022 @10:55AM (#32825084)
> This catches issues all the time where the api response or something has changed unexpectedly and the UI gets stuck half way on an error.

We've found that Typescript and a bit of boilerplate has almost entirely eliminated these types of concerns for us.

Re:A development process to ship features fast by suzzer99 on Tuesday September 13, 2022 @12:53AM (#32820771)
I agree on front end unit tests. Also on the usefulness of selenium tests. The only problem is they're flaky and slow as hell. But still worth it imo.