[AAE-4863] Fixed the async and done warning due to new version of Karma (#6938)

* [AAE-4863] Fixed the async and done warning due to new version of Karma

* Fixed lint error
This commit is contained in:
Sushmitha V
2021-04-22 11:05:13 +05:30
committed by GitHub
parent bf70e471ce
commit dd56588df8

View File

@@ -30,21 +30,20 @@ const preventAngularFromResetting = () => (TestBed.resetTestingModule = () => Te
const allowAngularToReset = () => (TestBed.resetTestingModule = resetTestingModule);
export const setupTestBed = (moduleDef: TestModuleMetadata) => {
beforeAll((done) =>
(async () => {
beforeAll((done) => {
localStorage.clear();
sessionStorage.clear();
resetTestingModule();
preventAngularFromResetting();
TestBed.configureTestingModule(moduleDef);
await TestBed.compileComponents();
// prevent Angular from resetting testing module
TestBed.resetTestingModule = () => TestBed;
})()
.then(done)
.catch(done.fail)
TestBed.compileComponents()
.then(() => {
TestBed.resetTestingModule = () => TestBed;
done();
})
.catch(done.fail);
}
);
afterAll(() => allowAngularToReset());
};