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

nyc test coverage not working with my project #1206

Closed
1 task done
duongduckien opened this issue Oct 15, 2019 · 6 comments
Closed
1 task done

nyc test coverage not working with my project #1206

duongduckien opened this issue Oct 15, 2019 · 6 comments
Labels

Comments

@duongduckien
Copy link

duongduckien commented Oct 15, 2019

https://github.com/duongduckien/backend-chat-app

Expected Behavior

I have already written 12 unit test with mocha, sinon, and chai. but the test coverage doesn't seem work correctly. all the statement isn't covered at all.

here is my nyc config:

"nyc": {
    "check-coverage": true,
    "all": true,
    "cache": false,
    "watermarks": {
      "lines": [
        80,
        95
      ],
      "functions": [
        80,
        95
      ],
      "branches": [
        80,
        95
      ],
      "statements": [
        80,
        95
      ]
    },
    "exclude": [
      "src/migrations",
      "src/seeds",
      "tests/",
      "ormconfig.ts",
      "src/app.ts"
    ],
    "include": [
      "src/**/*.ts"
    ],
    "extension": [
      ".ts"
    ],
    "require": [
      "ts-node/register"
    ],
    "reporter": [
      "text-summary",
      "html"
    ],
    "sourceMap": true,
    "instrument": true
  }

i don't know why it didn't cover the statement in the test case. did I do wrong the config

Observed Behavior

Troubleshooting steps

  • still occurring when I put cache: false in my nyc config

Environment Information

Screen Shot 2019-10-15 at 6 08 59 PM

Screen Shot 2019-10-15 at 6 11 23 PM

Screen Shot 2019-10-15 at 6 23 02 PM

@duongduckien
Copy link
Author

duongduckien commented Oct 15, 2019

it's working when I run the test with npm, I ran yarn before.
but got the broken
Screen Shot 2019-10-16 at 3 15 32 PM
HTML report

@narwajea
Copy link

See #921 and yarnpkg/yarn#6746.

@coreyfarrell
Copy link
Member

@duongduckien please test with nyc@next and let us know if that works for you.

@j0nathan-ll0yd

This comment has been minimized.

@coreyfarrell
Copy link
Member

@j0nathan-ll0yd please open a new issue providing all required information.

@stale
Copy link

stale bot commented Dec 4, 2020

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Dec 4, 2020
@stale stale bot closed this as completed Dec 12, 2020
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

4 participants