Skip to content
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.

The pipe 'translate' could not be found in uni test #70

Open
archive-me opened this issue Dec 12, 2019 · 1 comment
Open

The pipe 'translate' could not be found in uni test #70

archive-me opened this issue Dec 12, 2019 · 1 comment

Comments

@archive-me
Copy link

when i want to run ng test, the output karma is: The pipe 'translate' could not be found ...
my .spec.ts file

`import {async, ComponentFixture, TestBed} from '@angular/core/testing';

import {DashboardComponent} from './dashboard.component';

describe('DashboardComponent', () => {
let component: DashboardComponent;
let fixture: ComponentFixture;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [DashboardComponent]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(DashboardComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
`

output karma:
Screen Shot 1398-09-21 at 11 43 30

@dkimmich-onventis
Copy link

You have to import the TranslateModule:

beforeEach(async(() => {
  TestBed.configureTestingModule({
  imports: [TranslateModule.forRoot()],
  declarations: [DashboardComponent]
})
.compileComponents();
}));

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants