I have the following error caused in the spec.ts
It is given by this function.
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [UserPanelComponent]
}).compileComponents();
}));
The description is:
[Jest]{{ [ERROR ->]'userPanelUserRol' | translate:userPanelUserRol }}</span> </strong> </li>"):
ng:///DynamicTestModule/UserPanelComponent.html@6:15
The pipe 'translate' could not be found (" </li> <li> <a href="#" clrDropdownItem>{{ [ERROR ->]'userPanelUserInformation' | translate:userPanelUserInformation }}</a> </li> <li>"): ng:///DynamicTestModule/UserPanelComponent.html@10:35
The pipe 'translate' could not be found (" </li> <li> <a href="#" clrDropdownItem>{{ [ERROR ->]'userPanelPassword' | translate:userPanelPassword }}
</a> </li> <li>"):
ng:///DynamicTestModule/UserPanelComponent.html@13:35The pipe 'translate' could not be found (" </li> <li> <button class="btn-disconnect"> {{
[ERROR ->]'userPanelLogout' | translate:userPanelLogout }}</button> </li></ul>"): ng:///DynamicTestModule/UserPanelComponent.html@16:39
I do not understand why it gives an error in this file if I have not touched it, and I do not know that because it gives an error if everything works correctly.
New ----
> >import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { TranslateModule, TranslateLoader, TranslateFakeLoader } from '@ngx-translate/core';
import { UserPanelComponent } from './user-panel.component';
import { ConfigService } from '../config.service';
import { NO_ERRORS_SCHEMA } from '@angular/core';
describe('UserPanelComponent', () => {
let component: UserPanelComponent;
let fixture: ComponentFixture<UserPanelComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [UserPanelComponent],
providers: [ConfigService],
schemas: [NO_ERRORS_SCHEMA],
imports: [
TranslateModule.forRoot({
loader: { provide: TranslateLoader, useClass: TranslateFakeLoader }
})
]
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(UserPanelComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
The error is:
Invalid provider for the NgModule 'DynamicTestModule' - only instances of Provider and Type are allowed, got: [?[object Object]?, ...]
The new error is split undefined