Skip to content

Angular jsonforms causes test failures with --code-coverage #1886

@Ketec

Description

@Ketec

Describe the bug

TypeError: Cannot read properties of undefined (reading '$state')
It seems like Istanbul (karma code coverage) fails to detect the JsonFormsAngularService injections.

Potentially because it is not decorated as an injectable in the code?

This causes any component that uses to fail - manually providing JsonFormsAngularService in the test providers does not help.

Runs fine if coverage is disabled.

Expected behavior

Tests should run when using jsonforms.

Steps to reproduce the issue

USe </ in a component.
Write unit test for the component (as long as it initializes.)

ng test --browsers=headless --watch=false --code-coverage

Screenshots

No response

In which browser are you experiencing the issue?

All

Framework

Angular

RendererSet

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions