DEV Community

Discussion on: Unit Testing in Angular - To TestBed or NOT to TestBed

Collapse
 
stealthmusic profile image
Jan Wedel

We are also on that same path. We were used to writing tests with TestBed and then started to refactor all of them to real unit test, putting more emphasis on integration tests with Cypress and backend mocks.

TestBed was just to slow and adding all modules for dependencies was really tedious.

It’s interesting though, that there is a speed up to be expected with Angular 9.

Collapse
 
jordanpowell88 profile image
Jordan Powell

Their is a noticeable speed improvement with IVY (version 9+). It is nice to have the option to use TestBed when you want to but the main point of the article was that I don’t believe it is necessary in almost all use cases and in the end isn’t then truly a unit test