Skip to content

Commit

Permalink
workaround to issue topnotch48#38 to remove jasmine deprecation message
Browse files Browse the repository at this point in the history
  • Loading branch information
sinsunsan committed Nov 27, 2021
1 parent 4cb3b2a commit 6fec51b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions projects/ng-bullet/src/testing.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ComponentFixture, TestBed, getTestBed } from '@angular/core/testing';

import { Type } from '@angular/core';
import { ComponentFixture, getTestBed, TestBed } from '@angular/core/testing';

/**
* Reconfigures current test suit to prevent angular components re-compilation after every test run.
Expand All @@ -20,11 +21,13 @@ export const configureTestSuite = (configureAction?: () => void) => {
});

if (configureAction) {
beforeAll((done: DoneFn) => (async () => {
beforeAll((done: DoneFn) => {
(async function() {
configureAction();
await TestBed.compileComponents();
})().then(done).catch(done.fail));
}
}().then(done).catch(done.fail));
});
}

afterEach(() => {
testBedApi._activeFixtures.forEach((fixture: ComponentFixture<any>) => fixture.destroy());
Expand Down

1 comment on commit 6fec51b

@sinsunsan
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apply the workaround mentioned in this issue topnotch48#38

Please sign in to comment.