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

What is the test coverage? #214

Open
SandZn opened this issue Jun 30, 2022 · 5 comments
Open

What is the test coverage? #214

SandZn opened this issue Jun 30, 2022 · 5 comments

Comments

@SandZn
Copy link

SandZn commented Jun 30, 2022

I ran the npm run test, and got a result of "57 tests passed". Is there any information about the radio on test coverage?

@Caesarovich
Copy link

You can run AVA with the --verbose flag to list every tests when they are passed.

npx ava --verbose

Or else you can look at the test directory to have deep insights on the tests.
I hope that answers your question.

@SandZn
Copy link
Author

SandZn commented Jul 18, 2022

Thanks for the reply. I can list all tests that are passed, and there are 57 tests in total. But sadly, I still don't know the code coverage information of the test. (Some npm packages show their code coverage such as 94% or 100%.)

@voxpelli
Copy link
Contributor

You can run ava with c8 to calculate code coverage: https://github.com/avajs/ava/blob/main/docs/recipes/code-coverage.md

Though bigger question is: What causes your interest?

It's easy to get a 100% test coverage, it's much harder to write tests that actually verifies the intended functionality.

Highlighting code coverage isn't very useful and not a very good metric to eg. evaluate modules by.

@SandZn
Copy link
Author

SandZn commented Jul 20, 2022

Cool! c8 works well. Thanks for the advice 🌹

I'm doing research about Software Analysis; I need to collect popular projects with high code coverage tests.😊

@dilraj-vidyard
Copy link

Such a cool discussion :)

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

4 participants