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

Coverage report results to 0 lines covered even with unit and functional test #403

Open
jcjp opened this issue May 20, 2022 · 1 comment
Labels

Comments

@jcjp
Copy link

jcjp commented May 20, 2022

  • Version: ^7.11.2
  • Platform: Windows 11

Code coverage results in 0 even if there are unit and functional test added. I am using Adonis framework v5 and Japa for unit test and incorporating c8 for code coverage, here is the result:

Test: C8

I also have it reported here: Japa + c8 coverage uncovered even with test

Update: Looks like it c8 doesn't record the test I created using nock library for mocking http request or even the functional test from Adonis itself.

Created a repo for the issue: Adonis c8 controller uncovered

@bcoe bcoe added the question label May 24, 2022
@jcjp
Copy link
Author

jcjp commented Jun 19, 2022

Just an update looks like c8 coverage is now working as expected. We refactored our functional test and it seems that the issue was in relation to our messaging queue affecting our test and mixing unit and functional test and using nock, the library nock have an effect with the overall endpoints and the functional test.

In summary don't use nock and do functional test at the same time. Either use nock for unit test only with no functional, or just go with functional test. Feel free to close this question.

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

No branches or pull requests

2 participants