Skip to content

Running tests with --test-coverage-branches (same for lines|functions) doesn't emit test:fail when threshold isn't met #54812

Description

@rozzilla

Version

22.8.0

Platform

Darwin N4V4PGFGPT 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:16:46 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T8112 arm64

Subsystem

No response

What steps will reproduce the bug?

I'm running Node with the following options:

 --experimental-test-coverage --test-coverage-exclude='**/__tests__/**' --test-coverage-branches=95 --env-file=.env.test

and calling an executable that calls the run method as by doc.

If a test fails, a test:fail event is properly emitted.
If the coverage threshold is not met, I get a message from the test:diagnostic event like Error: 82.35% function coverage does not meet a threshold of 95%. (I get the same on the stdout). But no test:fail event is emitted, which makes it harder to detect it.

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

test:fail event should be emitted once coverage is not meet

What do you see instead?

no test:fail event emitted

Additional information

same thing apply when using --test-coverage-functions or --test-coverage-lines options

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    coverageIssues and PRs related to Node.js code coverage support.feature requestIssues requesting new Node.js features.test_runnerIssues and PRs related to the test runner subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions