Angular 2 / 4 - How to test Directive @Input values?
问题 So I have a Directive that takes an input: @Directive({ selector: '[my-directive]' }) export class MyDirective { @Input('some-input') public someInput: string; } As you can see, the input should be a string value. Now, I want to write a test for this Directive, and I want to test if the input satisfies the string type: describe('MyDirective', () => { let fixture: ComponentFixture<DummyComponent>; let dummy: DummyComponent; let directive: DebugElement; beforeEach(async(() => { TestBed