मेरे पास 'myPipe' नामक एक कस्टम पाइप है। मुझे पाइप 'मायपाइप' मिल रहा है मेरे यूनिट टेस्ट टीएस में त्रुटि नहीं मिली।कोणीय 2 यूनिट टेस्ट: कस्टम पाइप त्रुटि पाइप नहीं मिली
दलीलों सलाह क्या आयात और मेरे .spec.ts
में घोषित करने के लिए यहाँ मेरी .spec.ts
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { MyComponent } from './main-page-carousel.component';
describe('CarouselComponent',() => {
let component: MyComponent ;
let fixture: ComponentFixture<MyComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ MyComponent ],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(MyComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create',() => {
expect(component).toBeTruthy();
});
});
धन्यवाद है!
आप 'मायपाइप' के बारे में बात कर रहे हैं लेकिन आपका परीक्षण 'कैरोसेल कॉम्पोनेंट' से संबंधित है? आपको इसके बजाय 'myPipe' आयात नहीं करना चाहिए? –
यह भी देखें "पाइप नहीं मिला" प्रविष्टि: http://stackoverflow.com/questions/39007130/the-pipe-could-not-be-found-angular2- कस्टम-pipe/40770507#40770507 – Karl