Writing unit test cases for ngx-monaco-editor

Viewed 307

I have implemented the ngx-monaco-editor and its working fine, Now I have to write the unit test for the same.I have created a action on the editor "Add to DB" which will call rest api and will add the same in db.

HTML:

<ngx-monaco-editor style='height: 520px' [options]="editorOptions" [(ngModel)]="code" (onInit)="onInit($event)" #editor>
</ngx-monaco-editor>

I am not able to mock the onInit function in angular test case. When using Viewchild its not giving the instance of the editor in unit tests.

0 Answers
Related