Running into random unit test failures with this failure mode
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
Some of these tests that failed do not even have async testing going on!
Wondering if this snippet of code is correct or not; it is a pattern we use across the board in all tests in Angular
beforeEach(async(() => {
TestBed.configureTestingModule({ . // Should this be **return TestBed.configureTestingModule**
imports: [
...CommonTestModules
],
declarations: [FooComponent]
})
.compileComponents();
}));
Should the promise of compileComponents be returned from the callback? I read somewhere that the promises are awaited for by the async wrapper which eventually calls done() when the promises are resolved. But here this pattern looks like it is not returning the promise and we are not invoking the "await" keyword anywhere either. Does this code appear wrong without the return statement?