sindresorhus / meow

🐈 CLI app helper
MIT License
3.53k stars 150 forks source link

What is the test coverage? #214

Open SandZn opened 2 years ago

SandZn commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 1 year ago

Such a cool discussion :)