0

A linting error indicates:

deprecation group is deprecated: This API is not typesafe and can result in issues with Closure Compiler renaming. Use the FormBuilder#group overload with AbstractControlOptions instead.

I have read other question were the answer indacates the changes in formBuilder.group() however I only recieve the error in my spec.ts files for testing using Karma Jasmine.

I implement the test using SpyObjects and the implementation is as follows:

formBuilder = jasmine.createSpyObj<FormBuilder>('formBuilder', ['group']);
formBuilder.group.and.returnValue({ valueChanges: EMPTY, value: {} } as any);

The warning is shown for each line with formBuilder.group

lefanous
  • 75
  • 1
  • 6
  • group is deprecated. See [this][1] . [1]: https://angular.io/api/forms/FormBuilder Related: https://stackoverflow.com/questions/65155217/formbuilder-group-is-deprecated – Vugar Abdullayev Sep 13 '21 at 12:22
  • I am aware of the deprication. However I am having a hard time spotting how to reimplement the `formBuilder.group` in the test to satisfy the linter. – lefanous Sep 13 '21 at 12:33
  • Have you checked https://stackoverflow.com/questions/65155217/formbuilder-group-is-deprecated? – Vugar Abdullayev Sep 13 '21 at 12:36
  • Yes, I have. However as I'm not using ValidatorFn in my test implementation. – lefanous Sep 13 '21 at 12:43

0 Answers0