jeudi 6 février 2020

Angular Karma testing prototype function

When I am trying to run ng test, I get an error that

Property 'myFunction' does not exist on type 'FormArray'

And it is a property that was added to app.module.ts to make it global.

And it is a prototype to extend AbstractControl adding myFunction so it can be called on an AbstractControl objects. (done exactly like here https://stackoverflow.com/a/47065916)

What I can do to make Karma acknowledge that it is used correctly or make it ignore it?

edit: Full error:

ERROR in app/modules/settings/components/some-folder/some-folder2/some-folder3/some-folder4/myComponent.component.ts:74:23 - error TS2339: Property 'myFunction' does not exist on type 'FormArray'.

74 myFormArray.addValidators([MyValidator(someList)]);

Aucun commentaire:

Enregistrer un commentaire