DEV Community

Discussion on: Unit testing frontend code is (probably) useless

 
lexlohr profile image
Alex Lohr

Say, if you're testing on the back end, you don't have an operating system running underneath and libraries to support both your code and your tests and don't mock user behavior (i.e. requests, data, profiles)?

Also, we have 2022, in case you didn't notice. Running automated tests with a virtual DOM is rather simple now. Yes, you can be bad at unit testing front end code, but ignorance about something is not a valid reason that it is inherently bad.

Thread Thread
 
polterguy profile image
Thomas Hansen

Running "unit tests" relying upon the DOM is like saying "killing for peace". I've explained why in my former comment to you, and I don't like repeating myself, and you did not answer my concerns.

Thread Thread
 
lexlohr profile image
Alex Lohr

Let's agree to disagree. The DOM is merely the operating system of the front end. There's nothing complicated about testing in this environment.