cipchk / ngx-highlight-js

Angular for syntax highlighting with highlight.js
https://cipchk.github.io/ngx-highlight-js/
MIT License
28 stars 4 forks source link

NG Test fails #7

Closed Adam-Kernig closed 4 years ago

Adam-Kernig commented 5 years ago

When importing HighlightJsModule into a component.spec file for the test bed a test shows this error: AddRemoveModalsComponent should create FAILED ReferenceError: hljs is not defined

How can I define this? I cant seem to find any docs relating to unit testing with this package

Adam-Kernig commented 5 years ago

example testbed

beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ AppBarComponent ], imports: [ HighlightJsModule ] }) .compileComponents(); }));

diogobernardelli commented 5 years ago

@Adam-Kernig Have you fix it? If so, how?

Adam-Kernig commented 5 years ago

@diogobernardelli Apologies mate I ended up not using this package and writing one myself, it turned out to be quicker doing so

cipchk commented 5 years ago

@diogobernardelli You can try define hljs in typing.d.ts.