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 coverage shows 0% #239

Open
ankitkhedekar opened this issue Mar 25, 2020 · 3 comments
Open

nyc coverage shows 0% #239

ankitkhedekar opened this issue Mar 25, 2020 · 3 comments

Comments

@ankitkhedekar
Copy link

i have been trying to use riteway, in one of my sideprojects. When trying to get it working with instanbul coverage report it shows 0% coverage.

I currently have only a single test.js file , it imports a class from another js file, and runs tests on it.

Output:


    ----------|---------|----------|---------|---------|-------------------
    File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
    ----------|---------|----------|---------|---------|-------------------
    All files |       0 |        0 |       0 |       0 |
    ----------|---------|----------|---------|---------|-------------------

  passed: 2,  failed: 0  of 2 tests  (4.1s)

package.json

   "test": "riteway -r @babel/register -r @babel/polyfill src/**/*-test.js",
    "coverage": "nyc npm run test  | tap-nirvana",

.babelrc

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "targets": [
          "last 2 versions",
          "safari >= 7"
        ]
      }
    ],
  ],
  "plugins": ["istanbul"]
}

.nycrc

{
    "extends": "@istanbuljs/nyc-config-babel"
}
@ericelliott
Copy link
Collaborator

Have you tried nyc riteway -r @babel/register -r @babel/polyfill src/**/*-test.js?

@ankitkhedekar
Copy link
Author

Yes, I tried this as well, still shows 0 %

1..2
# tests 2
# pass  2

# ok

----------|---------|----------|---------|---------|-------------------
File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files |       0 |        0 |       0 |       0 |
----------|---------|----------|---------|---------|-------------------

both subject and test file for reference:
https://github.com/ankitkhedekar/angular-cric-scorer/tree/master/src/app/common

@ericelliott
Copy link
Collaborator

I wouldn't know how to begin investigating this. Have you asked the nyc team about this?

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

2 participants