У меня проблема с единичным тестом в угловом 5 с жасмином и кармой.
Ошибка: "Невозможно привязать к" плодам ", так как это не известное свойство" my-component2 ".
Единичный тестовый код:
SRC/приложение/компоненты/мой-component1/мой-component1.component.spec.ts:
import { TestBed, inject, ComponentFixture, async} from '@angular/core/testing';
import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing';
import { Post } from '../../models/post.model';
import { MyComponent1Component } from './my-component1.component';
import { MyService1Service } from '../../services/my-service1.service';
import { HttpClientModule, HttpClient,HttpHandler } from '@angular/common/http';
import {fruit} from '../../Models/fruit';
fdescribe('MyComponent1Component', () => {
let component: MyComponent1Component;
let fixture: ComponentFixture<MyComponent1Component>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ MyComponent1Component ],
imports: [],
providers: [MyService1Service, HttpClient, HttpHandler, HttpTestingController]
})
.compileComponents();
}));
beforeEach(async(() => {
fixture = TestBed.createComponent(MyComponent1Component);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});