From dc2cdcc59855e9d2aa3e55f9877a8755483af619 Mon Sep 17 00:00:00 2001 From: Lukas Kullmann Date: Fri, 30 Jul 2021 09:59:55 +0200 Subject: [PATCH] feat: destroy fixture in cleanup (#240) --- projects/testing-library/src/lib/testing-library.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/testing-library/src/lib/testing-library.ts b/projects/testing-library/src/lib/testing-library.ts index 13ed320e..95f28fc7 100644 --- a/projects/testing-library/src/lib/testing-library.ts +++ b/projects/testing-library/src/lib/testing-library.ts @@ -363,6 +363,8 @@ function cleanup() { } function cleanupAtFixture(fixture) { + fixture.destroy(); + if (!fixture.nativeElement.getAttribute('ng-version') && fixture.nativeElement.parentNode === document.body) { document.body.removeChild(fixture.nativeElement); }