I have a directive in Angular that highlights blue in style.
import { Directive, ElementRef } from '@angular/core';
@Directive({
selector: '[appHighlight]'
})
export class HighlightDirective {
constructor(el: ElementRef) {
el.nativeElement.style.color = 'blue';
}
}
When I want to write the test is says "An argument for el was not provided" above HighlightDirective():
import { HighlightDirective } from './highlight.directive';
describe('HighlightDirective', () => {
it('should create an instance', () => {
const directive = new HighlightDirective();
expect(directive).toBeTruthy();
});
});
What do I have to include in () to the HighlightDirective? Thanks!
Please help!