Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Karma coverage exit code depends on the order of the reporters array #471

Open
mcdenhoed opened this issue Mar 15, 2022 · 0 comments
Open

Comments

@mcdenhoed
Copy link

I'm using karma and karma-coverage in a CI context, failing the CI job when a test fails or coverage is too low. I get this information from the exit code returned by karma.

However, I noticed that karma doesn't return an error for low coverage IF the text-summary reporter is placed before the html reporter.

I've made a small repo showcasing this: https://github.com/mcdenhoed/karma-test

Is this expected? I didn't find any documentation indicating that the order of the reporters array was important. I've fixed my own use-case by just changing my karma.conf.js to have

      reporters: [
        {type: "html"},
        {type: "text-summary"},
      ]

instead of

      reporters: [
        {type: "text-summary"},
        {type: "html"},
      ]

This doesn't seem to me like intended behavior, but if it is, a note in the docs about it would be nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant