Skip to content

Conversation

@radomir-sebek
Copy link
Collaborator

@radomir-sebek radomir-sebek commented Jun 3, 2025

Two improvements come with this PR:

  1. swapping nyc to c8
  • When trying to calculate coverage with nyc, I am always getting 0% with existing scripts/tooling. It seems that nyc (Istanbul) was originally designed for CommonJS, and its code instrumentation hooks into the require system. By looking at test/*.test.js I can see code instrumented as ESM (with import ... from ...), so it NYC cannot instrument source files, at least not right away so I would need to use additional loader or similar.
  • Internet tells me that c8 works natively with ESM and its recommended for ESM projects.

before:
before
after:
after

  1. added html reporter and exposed calculated artefacts so they can be accessible also on demand

PS. If there is ever desired to require minimum coverage threshold, one can set check-coverage to true and "demand" /instrument line coverage, or any of (functions, statements, branches) to not go bellow specified threshold. For now, its disabled.

  "check-coverage": false,
    "lines": 80 , 

@radomir-sebek radomir-sebek self-assigned this Jun 3, 2025
@radomir-sebek radomir-sebek marked this pull request as ready for review June 3, 2025 19:28
Copy link
Contributor

@Bojan131 Bojan131 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great i really like it. We can talk about expanding these to other repos on the QA Guild. Lets wait for Mihajlo to also take a look and approve if everything is ok on his side

@radomir-sebek
Copy link
Collaborator Author

This looks great i really like it. We can talk about expanding these to other repos on the QA Guild. Lets wait for Mihajlo to also take a look and approve if everything is ok on his side

Thank you, sure, lets see if @Mihajlo-Pavlovic gives thumbs up here, I would love to merge it soon :)

@radomir-sebek radomir-sebek merged commit 257af5c into v8/develop Jun 6, 2025
2 checks passed
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

Successfully merging this pull request may close these issues.

4 participants