I'm submitting a ... (check one with "x")
[ x] bug report => check the FAQ and search github for a similar issue or PR before submitting
[ ] support request => check the FAQ and search github for a similar issue before submitting
[ ] feature request
Current behavior
ngx-translate is impossible to test.
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [TileComponent],
providers: [TranslatePipe]
});
fixture = TestBed.createComponent(TileComponent);
Expected/desired behavior
Spend more time on SEO instead of github issue templates:
http://lmgtfy.com/?q=The+pipe+%27translate%27+could+not+be+found
Do you want to test your TileComponent or do you want to test the pipe?
In our project we go the way to mock the translatepipe:
@Pipe({
name: "translate"
})
export class TranslatePipeMock implements PipeTransform {
public name: string = "translate";
public transform(query: string, ...args: any[]): any {
return query;
}
}
and then use that mock in the testbed:
declarations: [TranslatePipeMock]
Any suggestions in my issue #627??
For problemns with Jasmine test.
Its works for me guys 馃槈
Add this on MyComponent..component.spec.ts
import { TranslateModule } from "@ngx-translate/core";
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ EmailMessageComponent ],
imports: [
TranslateModule.forRoot(),
]
})
.compileComponents();
}));
Most helpful comment
Do you want to test your TileComponent or do you want to test the pipe?
In our project we go the way to mock the translatepipe:
and then use that mock in the testbed:
declarations: [TranslatePipeMock]