TestBed

Angular's test helper that builds a small app environment for a component under test.

What is TestBed?

TestBed is Angular's test helper. It builds a mini Angular environment so a test can create a component, give it fake services and check what it renders.

const fixture = TestBed.createComponent(Greeting);
fixture.detectChanges();
expect(fixture.nativeElement.textContent).toContain('Hello');

Level: Freelancer · More Angular terms at this level

Updated