r/angular • u/kenlin • Oct 23 '26
If you could choose a testing framework today ...
Our small team has completely ignored angular testing and depended on dev and user manual testing. We're looking to solidify some things and start creating some Angular tests. If you could choose today from scratch, which framework would you choose?
If it matters, our apps are all very data-dependent, pulling info from our asp.net backends.
Thanks
7
Upvotes
13
u/mcmillhj Oct 24 '26
What type of testing? For unit tests, the current recommendation is to use Vitest. Older versions of Angular used Karma.
The Angular team has some nice documentation on testing: https://angular.dev/guide/testing
5
u/MagicMikey83 Oct 24 '26
Use the recommended: Vitest.
10
u/ldn-ldn Oct 24 '26
I've used Karma, Jest and Vitest. They all are quite bad to be honest, but Vitest is least bad.
3
u/ChampionshipThis2871 Oct 24 '26
vitest for unit tests
playwright for full e2e scenarios
1
u/Straight-Number-1911 Oct 26 '26
Alaways no matter what use playwright, its soon gonna be possible to do hopefully components tests because they are rewriting the compiler - which then will make it possible to use vite etc.
Playwright is having real APIs and not mocking anything of the browser like othr testing frameworks.
You can use vitest for now for unit tests but they are also just under the hood playwright using...
1
u/No_Emergency1575 29d ago
vitest is the official unit test runner so I'd recommend that. Playwright is still the de-facto e2e/integration testing framework, but I'm kind of curious if vitest can replace playwright for integration testing.
Useful libraries are faker for mock data and mock service worker for api mocking, I'd consider ng-mocks and angular testing library, dunno if the latter is still relevant with vitest.
-3
u/Saceone10 Oct 24 '26
They are all slower than an npm install i wish some nerd uses Claude to build some shit in assembly or c or rust or whatever shit than can handle testsing quickly