Angular 4 fixture component persists in DOM during Jasmine tests
Jasmine nor Angular will ever remove it automatically, maybe to help you to get more details about your test execution. To remove it you simply use afterEach(…), like: beforeEach(() => { fixture = TestBed.createComponent(MyComponent); comp = fixture.componentInstance; debugElement = fixture.debugElement; element = debugElement.nativeElement; }); afterEach(() => { document.body.removeChild(element); }); For none Angular users: afterEach(() => … Read more