Skip to content

AngularFirePerformance incompatible with Jest #2812

Closed
@spicemix

Description

@spicemix

If I import AngularFirePerformance anywhere reachable by my Jest unit tests (part of @nrwl/nx) I get

TypeError: window.performance.mark is not a function

The error is right on the import, no additional code needed.

The likelihood is this is an incompatibility with Jest's performance-related code. Trying to copy over values from perf_hooks didn't work although it changed the error reports. I am opening the issue here to see if anyone has ideas how to fix this. I am using the latest stable versions of everything.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions