'CKEDITOR is not defined - Karma Angular Test

we have a component in our application where we use CKEDITOR but the karma is not able to load the editor while running the ng test which error ''CKEDITOR is not definded ' at component.onInit(). I have tried adding types to karma.config plugins as require('@types/ckeditor') but still no success. Is there a way to tell karma to load the ckeditor when required.



Solution 1:[1]

Both CKEditor and Karma config must be available in your package.json.

CKEditor can be integrated into your application by adding generating the build online and adding it to the respective parent folder. It will also generate file ckeditor.js

Once integrated

import * as Editor from 'src/app/ckeditor/ckeditor';

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Vinay Somawat