mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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:
@@ -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());
|
||||
};
|
||||
|
Reference in New Issue
Block a user