TestBed exists to configure Angular’s dependency injection and compile templates. If your test does neither, it is paying for both.
What to test how
- Services and pure logic: construct the class with plain objects for dependencies. No TestBed, no async, no fixtures.
- Component logic: with signals and standalone components, an instance can often be created directly and its methods called, which covers most of the interesting behaviour.
- Templates and interaction: TestBed, or better, a component harness that tests what a user can do rather than which class is present.
The gain is not only speed, although a suite going from four minutes to forty seconds changes whether people run it. It is that a test constructed without a framework fails for one reason, while a TestBed test can fail because of a missing provider in a module you did not write.
2 Comments
Leave a comment
Sign in to leave a comment.
Signing in is unavailable right now.







Daan Visser
June 24, 2025Four minutes to forty seconds is exactly our numbers after doing this. People started running tests locally again.
Muhammed Senussi
AuthorJune 24, 2025That second-order effect is the real prize. A suite nobody runs locally is a suite that only fails in CI, which is the most expensive place to find out.