If you are getting the following error while running ng test:
Error: NG0302:
The pipe 'paginate' could not be found in the YourComponent component.
The solution is to import NgxPaginationModule in your spec file of your component:
beforeEach(async () => {
await TestBed.configureTestingModule({
imports:[NgxPaginationModule]
}).compileComponents();
The complete file will look like this:
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { NgxPaginationModule } from 'ngx-pagination';
import { YourComponent } from './YourComponent.component';
describe('YourComponent', () => {
let component: YourComponent;
let fixture: ComponentFixture<YourComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports:[NgxPaginationModule],
declarations:[....YourDeclarationsIfNeeded]
}).compileComponents();
fixture = TestBed.createComponent(YourComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});