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

Can't seem to include my source TypeScript file #1159

Closed
1 task done
mightyiam opened this issue Aug 19, 2019 · 10 comments
Closed
1 task done

Can't seem to include my source TypeScript file #1159

mightyiam opened this issue Aug 19, 2019 · 10 comments

Comments

@mightyiam
Copy link

Link to bug demonstration repository

https://github.com/cycle-components/component-template/pull/67
See the Travis CI runs. No files seem to be covered.

Expected Behavior

I went over the changelog and read the docs about including files and I'm not sure what I'm doing wrong. Could you please take a look? It's a tiny public repo.

Include the source file just like it does in the master branch.

Observed Behavior

The source file does not seem to be included.

Troubleshooting steps

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

Environment Information

# paste the output here
 System:
    OS: Linux 5.0 Ubuntu 19.04 (Disco Dingo)
    CPU: (8) x64 Intel(R) Core(TM) i7-4720HQ CPU @ 2.60GHz
    Memory: 7.93 GB / 15.55 GB
  Binaries:
    Node: 12.8.0 - ~/.nvs/node/12.8.0/x64/bin/node
    npm: 6.10.2 - ~/.nvs/node/12.8.0/x64/bin/npm
  npmPackages:
    nyc: ^14.1.1 => 14.1.1 
    typescript: 3.5.3 => 3.5.3 

@coreyfarrell
Copy link
Member

Please add "extension": [".ts"] to your nyc configuration (in package.json). nyc 14 processes source-maps before running reports, filters out anything which does not match the specified filtering options (the extension list is one of those filters). In nyc@14 the extension list is just .js by default. nyc@15 will be adding .ts and a few others (#1110) to the default extension list.

@mightyiam
Copy link
Author

Oops. Missed that one. It must have been in the changelog, as well, which I did read. 🤷‍♂️.

Thank you, @coreyfarrell!

@mightyiam
Copy link
Author

And now it claims regarding what seems to be all of the lines, that they're not covered, while it seems that they should be.

https://github.com/cycle-components/component-template/pull/67

I don't mean to bother the maintainers of this project, but I'm kinda lost with this.

@coreyfarrell
Copy link
Member

I think it's probably wrong to configure "include": ["src/**/*"] if the tests are being run against "lib/**/*". I'd suggest removing the include option and maybe change the "exclude" option to ["**/*.test.*"]. It's a bit weird when dealing with pre-compiled sources but nyc has to be allowed to instrument the files in lib/** but it also has to be allowed to report on files in src/**.

@mightyiam
Copy link
Author

Thank you, @coreyfarrell, for your support. That piece of information of what to include and exclude in a transpiled project and why (instrument vs. report) would be great in the docs, I would suggest.

I know there's the TypeScript shareable config. Nonetheless...

@mightyiam
Copy link
Author

Thank you for your help so far, @coreyfarrell.

It seems like some CI runs pass with 100% coverage and others report 50% of statements are covered.
https://github.com/cycle-components/component-template/pull/67

A caching issue?

@coreyfarrell
Copy link
Member

Can you see what happens when you set "all": false to your nyc config? You are potentially hitting a bug which will be fixed in nyc@15.

@mightyiam
Copy link
Author

Thank you for the tip, @coreyfarrell. With "all": false it passed.

https://travis-ci.org/cycle-components/component-template/jobs/584692823

@coreyfarrell
Copy link
Member

Good to know. I recommend subscribing to #1104 so you get a notification when beta then final releases of nyc@15 are available.

@mightyiam
Copy link
Author

🙏 🏆 🙏

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