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 10.3.0 reports different results on second run compared to first run, 10.2.0 is OK #565

Closed
winksaville opened this issue May 4, 2017 · 3 comments · Fixed by #566
Closed

Comments

@winksaville
Copy link

Please use the template provided below, when reporting bugs:

I recently upgraded a TypeScript project, alsatian, from nyc version 10.3.0 from 10.2.0. On the first run nyc report gives the results from the ts files:

$ npm run test

> [email protected] pretest /home/wink/foss/alsatian
> npm run build

...

> [email protected] check-coverage /home/wink/foss/alsatian
> npm run build & nyc --reporter=lcov --reporter=html npm run unit-tests && npm run output-test-coverage

...

> nyc report

--------------------------------------|----------|----------|----------|----------|----------------|
File                                  |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
--------------------------------------|----------|----------|----------|----------|----------------|
All files                             |      100 |      100 |      100 |      100 |                |
 cli                                  |      100 |      100 |      100 |      100 |                |
  alsatian-cli-options.ts             |      100 |      100 |      100 |      100 |                |
  alsatian-cli.ts                     |      100 |      100 |      100 |      100 |                |
  cli-test-runner.ts                  |      100 |      100 |      100 |      100 |                |
 cli/errors                           |      100 |      100 |      100 |      100 |                |
  duplicate-cli-argument-error.ts     |      100 |      100 |      100 |      100 |                |
...
  type-matcher.ts                     |      100 |      100 |      100 |      100 |                |
 core/stringification                 |      100 |      100 |      100 |      100 |                |
  argument-stringifier.ts             |      100 |      100 |      100 |      100 |                |
  index.ts                            |      100 |      100 |      100 |      100 |                |
--------------------------------------|----------|----------|----------|----------|----------------|

But when I run it a second time the results are using the js files:

$ npm run test

> [email protected] pretest /home/wink/foss/alsatian
> npm run build

...

> [email protected] output-test-coverage /home/wink/foss/alsatian
> nyc report

--------------------------------------|----------|----------|----------|----------|----------------|
File                                  |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
--------------------------------------|----------|----------|----------|----------|----------------|
All files                             |    94.09 |    85.84 |    90.91 |    97.65 |                |
 cli                                  |    90.86 |    86.24 |     97.5 |    98.73 |                |
  alsatian-cli-options.js             |      100 |      100 |      100 |      100 |                |
  alsatian-cli.js                     |      100 |      100 |      100 |      100 |                |
  cli-test-runner.js                  |    83.18 |       80 |    94.74 |    97.14 |          22,23 |
 cli/errors                           |    79.49 |    55.56 |    72.41 |    88.57 |                |
...
  type-matcher.js                     |      100 |      100 |      100 |      100 |                |
 core/stringification                 |      100 |      100 |      100 |      100 |                |
  argument-stringifier.js             |      100 |      100 |      100 |      100 |                |
  index.js                            |      100 |      100 |      100 |      100 |                |
--------------------------------------|----------|----------|----------|----------|----------------|

Expected Behavior

Both runs should be the same and they are when using nyc 10.2.0.

Observed Behavior

The second run is based on js files not ts files.

Bonus Points! Code (or Repository) that Reproduces Issue

alsatian and also web-client-server-app-ts both use TypeScript and Alsatian.

Forensic Information

Operating System: the operating system you observed the issue on.

$ uname -a
Linux wink-envy 4.10.13-1-ARCH #1 SMP PREEMPT Thu Apr 27 12:15:09 CEST 2017 x86_64 GNU/Linux

Environment Information: information about your project's environment, see instructions below:

  1. run the following script:

sh -c 'node --version; npm --version; npm ls' > output.txt

  1. share a gist with the contents of output.txt.
    gist of output.txt
@bcoe
Copy link
Member

bcoe commented May 5, 2017

@winksaville could you please give this a shot:

npm i nyc@next

should have a fix for you.

@winksaville
Copy link
Author

winksaville commented May 5, 2017 via email

@bcoe
Copy link
Member

bcoe commented May 5, 2017

@winksaville 👍 awesome; keep me posted if you bump into any more issues -- excited to support TypeScript.

@bcoe bcoe closed this as completed May 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants