Code is working properly there is no issue on that, but While I test my angular code I got this following error.
what i have to add to get rid of this error. anyone please help me on this. i know array size get exceeded but how to fix that? RangeError: Invalid array length
component.ts
this.columns = Array.from(Array(this.nbColumn - 1 > 0 ? this.nbColumn - 1 : 0 ).keys())
spec.ts
describe('HomeComponent', () => {
let component: HomeComponent;
let fixture: ComponentFixture<HomeComponent>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports:[HttpClientModule,RouterTestingModule,MatSnackBarModule],
declarations: [ HomeComponent ],
providers:[ ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(HomeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
Edited: I have added my spec file