core icon indicating copy to clipboard operation
core copied to clipboard

_

Open ghost opened this issue 8 years ago • 3 comments

_

ghost avatar Aug 15 '17 17:08 ghost

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]

kartheininger avatar Aug 17 '17 06:08 kartheininger

Any suggestions in my issue #627??

erhimanshugarg avatar Aug 17 '17 09:08 erhimanshugarg

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(); }));

matheusmurta avatar Jan 23 '20 12:01 matheusmurta