Skip to content

adds coverage support for transpiled javascript source - #146

Closed
theseyi wants to merge 5 commits into
ember-cli-code-coverage:masterfrom
theseyi:master
Closed

adds coverage support for transpiled javascript source#146
theseyi wants to merge 5 commits into
ember-cli-code-coverage:masterfrom
theseyi:master

Conversation

@theseyi

@theseyi theseyi commented Nov 27, 2017

Copy link
Copy Markdown

@championswimmer

Copy link
Copy Markdown

what's the status of this ?

this allows coverage on .ts files, that was not possible earlier.

would love to see this merged

@RobbieTheWagner

Copy link
Copy Markdown
Collaborator

@adamjmcgrath do the new betas support transpiled sources? Typescript, Coffeescript, etc? If not, what would it take to land some of the tweaks from this PR?

@adamjmcgrath

Copy link
Copy Markdown
Collaborator

do the new betas support transpiled sources?

I just tested this on https://github.com/dfreeman/why-yes-i-do-have-types

I had to add ts to the list of extensions here: https://github.com/kategengler/ember-cli-code-coverage/blob/master/index.js#L204

But after that it seemed to work ok (not sure why branch coverage is 1/1 - possibly something to do with how it's transpiled?)

screen shot 2018-02-21 at 08 09 24

I would have thought, that for an ember-cli-typescript project, that extensionsForType('js') would return ts as well as js? If that were the case this would work without any additional effort.

@RobbieTheWagner

Copy link
Copy Markdown
Collaborator

@adamjmcgrath could we expose a config option to pass the extensions to report coverage for, like this PR did?

@dfreeman

dfreeman commented Feb 21, 2018

Copy link
Copy Markdown
Contributor

I just tested this on https://github.com/dfreeman/why-yes-i-do-have-types

😆 glad that's getting some use

I would have thought, that for an ember-cli-typescript project, that extensionsForType('js') would return ts as well as js?

We're doing some kind of odd things in ember-cli-typescript, but I think if we associate the ts extension to our ahem fake preprocessor it should fix extensionsForType().

Update: opened #164 here and typed-ember/ember-cli-typescript#144 to get this working end-to-end.

@RobbieTheWagner

Copy link
Copy Markdown
Collaborator

@dfreeman so this all works with typescript now, right? Can we close this?

@dfreeman

Copy link
Copy Markdown
Contributor

@rwwagner90 with master of ember-cli-code-coverage and source maps turned on, everything seems to work mostly correctly. Files seem to show up, and the coverage numbers appear to be right. The one odd thing is that the hit rates in the left gutter seem to be off by one line, and I'm not sure what's causing that.

@RobbieTheWagner

Copy link
Copy Markdown
Collaborator

@dfreeman I would consider that another bug. Do you mind opening an issue with the details and a screenshot of what you observed please? I am closing this issue for now.

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

Successfully merging this pull request may close these issues.

Does not work with CoffeeScript

5 participants