I'm trying to write a unit test for an angular component in a hybrid app. The component in question uses "let var = angular.element (.....)" in one of its methods, and this is the code that is causing the error.
The project builds fine, and everything works as expected.
However in the spec.ts file, the default test
it('should create', () => {
expect(component).toBeTruthy();
});
results in Karma throwing an error of "Reference Error: Angular is not defined".
I've tried looking for a solution but was unable to find anything relevant to this (there was one question with the same error but those projects used AngularJS and the deprecated bower package). I also tried declaring the angular node modules path in test => scripts in the Angular.json file but this lead to another error where Karma would timeout. I'm wondering if this issue is hybrid app specific?