Vitest is a brilliant software. I wish that the vitest vscode extension would be managed in a more careful manner though, too buggy for me to use.
show comments
halflife
Jest mocks allow developers to write bad code. Instead of separating concerns with DI, jest mocks overwrite the importing mechanism without any type safety. Also, if you wish to migrate to native node test runner, the mocks lock you into jest.
Use proper mocks with ts mockito and it will force you to write better code.
show comments
howToTestFE
learn step by step the main features of both Jest and Vitest (they're very similar for most common usages) in these interactive4 lessons
epolanski
I think unit testing FE to be borderline useless and very expensive to maintain.
I have seen so many broken products where leads where obsessed with 100% coverage and quality tests I just don't believe the methodology.
E2Es are the only tests that tell you whether the product is making money or not with a good approximation.
You have to invest in reducing flakiness and their run time, but if my 5 men team maintaining 6 products could, I think it can be done by more people, yet so many seem to be burned on their 10 year old experience..
Of course there are situations you want to test via normal unit tests and even do TDD (parsers/encoders/math stuff, etc) or you're writing libraries, but the people testing react components and such are involved in delusional productivity porn if that's not the case.
Vitest is a brilliant software. I wish that the vitest vscode extension would be managed in a more careful manner though, too buggy for me to use.
Jest mocks allow developers to write bad code. Instead of separating concerns with DI, jest mocks overwrite the importing mechanism without any type safety. Also, if you wish to migrate to native node test runner, the mocks lock you into jest.
Use proper mocks with ts mockito and it will force you to write better code.
learn step by step the main features of both Jest and Vitest (they're very similar for most common usages) in these interactive4 lessons
I think unit testing FE to be borderline useless and very expensive to maintain.
I have seen so many broken products where leads where obsessed with 100% coverage and quality tests I just don't believe the methodology.
E2Es are the only tests that tell you whether the product is making money or not with a good approximation.
You have to invest in reducing flakiness and their run time, but if my 5 men team maintaining 6 products could, I think it can be done by more people, yet so many seem to be burned on their 10 year old experience..
Of course there are situations you want to test via normal unit tests and even do TDD (parsers/encoders/math stuff, etc) or you're writing libraries, but the people testing react components and such are involved in delusional productivity porn if that's not the case.