core
core copied to clipboard
_
_
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(); }));