I'm trying to find a solution to this error:
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL
When I run karma unit tests with headless browser, test passes if run with chrome browser instead, also when my angular component has few lines of html the test passes.
Here's my test file,
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
fdescribe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent
],
}).compileComponents();
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
});
My component is very simple, does nothing but load the html template
import { Component } from '@angular/core';
@Component({
selector: 'pm-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
pageTitle: string = 'Angular: Getting Started';
}