question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suggestion: Pass in tsconfig path (potentially not reading `typeCoverage` in package.json)

See original GitHub issue

Firstly, great project! I’m looking forward to using this within the organisation in which I work, and potentially contributing to the project too!

Sadly, I am having a little difficultly getting this working, hopefully you can help.

Describe the bug Our project structure is as follows:

package.json
src/
  - app-component/app.ts ... etc
  - tsconfig.app.json

If I run type-coverage eg type-coverage --project src/tsconfig.app.json, then I get the following result:

77636 / 88900 87.32%
type-coverage success.

If I add the following to package.json, then I also get the result:

  "typeCoverage": {
    "project": "src/tsconfig.app.json"
  }

result:

77636 / 88900 87.32%
type-coverage success.

However, when I run typescript-coverage-report, (assuming it’ll take the config from package.json as per https://github.com/alexcanessa/typescript-coverage-report#usage), then I get the following:

> typescript-coverage-report

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ filenames (0) β”‚ percent (100.00%) β”‚ total (0) β”‚ covered (0) β”‚ uncovered (0) β”‚
β”‚ ---           β”‚               --- β”‚       --- β”‚         --- β”‚           --- β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
View generated HTML Report at {project}/coverage-ts/index.html

To Reproduce See above for detailed info, happy to refine if needed.

Expected behaviour Running typescript-coverage-report should return back the same type coverage as the type-coverage repo.

Screenshots N/a

Environment

  • Tool version: 0.5.1 (type-coverage @2.17.2)
  • OS: Mac
  • Node version: v14.5.0
  • Browser (if applicable): [e.g. chrome, safari]

Additional context N/a

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
alexcanessacommented, Apr 21, 2021

AMAZING, Thanks so much @tomardern

1reaction
tomarderncommented, Apr 20, 2021

I’ve created a Pull Request for this here - https://github.com/alexcanessa/typescript-coverage-report/pull/58

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jest + Typescript + Absolute paths (baseUrl) gives error
For example, if you have paths in tsconfig.json defined as follows ... or when Jest is not configured to support such syntax.
Read more >
TSConfig Reference - Docs on every TSConfig option
All relative paths found in the configuration file will be resolved ... the file extension and the value of the type setting in...
Read more >
Compiler options not working as expected when using project ...
tsconfig.json which references both of the above (using TypeScript's new "project references" feature). When running jest, it should read ...
Read more >
tsconfig-paths-webpack-plugin | Yarn - Package Manager
Use this to load modules whose location is specified in the paths section of tsconfig.json when using webpack. This package provides the functionality...
Read more >
TypeScript rules for Bazel - GitHub Pages
This package provides Bazel wrappers around the TypeScript compiler. ... For example you cannot use the --noEmit compiler option in tsconfig.json .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found