Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

jest works fine, but with the coverage flag many tests fail #151

@ctsstc

Description

@ctsstc

It seems when I just run npx jest everything runs just fine, all the tests pass in record time.

As soon as I try to pass the coverage flag over I get many failures ie: npx jest --coverage.

If I run the test suite that is failing in isolation everything seems to run fine ie: npx jest src/app.module.spec.ts --coverage --collectCoverageFrom=src/app.module.ts

If I remove the collectCoverageFrom flag then it proceeds to fail again ie: npx jest src/app.module.spec.ts --coverage

It seems as if many of the dependencies that are mocked out in a test are not being mocked. If I isolate the coverage collection it seems to be fine, but then it seems that when all the files are gathered for coverage it's causing issues. Is it trying to run the code crawling through the AST instead of through the spec implementation that mocks things out?

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