You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Interesting. This is likely a result of the modules being lazily resolved, so if you do not import a given module or force to evaluate it (via visiting a route or invoking a component) it wouldn't be reported.
@sandersky / @kategengler / @sglanzer - Can one of y'all confirm this? I can add a thing that basically requires all app files (to ensure they are being evaluated) if that is the case...
@wagenet did you get anywhere on this? I have a few devs that are going to start picking up the work around addon testing and we could take a look at this as well
I added the following to my tests/index.html after the <script src="assets/test-loader.js"></script> line.
<script>
Testem.afterTests(function() {if(window.__coverage__){Object.keys(require.entries).forEach(function(file){// Only load non-test files from our appvarparts=file.split('/');if(parts[0]==='direwolf'&&parts[1]!=='tests'){try{require(file);}catch(e){throw'error requiring file for coverage: '+file;}}});}});</script>
Happy to beta test this when ready — I just switched a large Ember app from ember-cli-blanket to this addon, coverage jumped from 55% to 85% due to this issue.
Happy to beta test this when ready — I just switched a large Ember app
from ember-cli-blanket to this addon, coverage jumped from 55% to 85% due
to this issue.
I got to the point where I basically store file patterns in config/coverage.js and would read in the files, but was never able to produce a coverage object (Istanbul's api documentation leaves something to be desired)so I could add it to the coverage report.
My only working solution was to merge the untested broccoli trees in, but I wasn't happy with that approach.
We're funky like that - just not sure if those concepts carry forward into the best practice version of a code coverage addon - someone else will need to make that call, my brain hasn't been in this space for a while
I'll try to find some time next week to sync with @rwjblue and @kategengler - probably should put together a roadmap for this and the addon coverage issues
Activity
rwjblue commentedon Jun 30, 2016
Interesting. This is likely a result of the modules being lazily resolved, so if you do not
importa given module or force to evaluate it (viavisiting a route or invoking a component) it wouldn't be reported.@sandersky / @kategengler / @sglanzer - Can one of y'all confirm this? I can add a thing that basically requires all app files (to ensure they are being evaluated) if that is the case...
sglanzer-fire commentedon Jun 30, 2016
@rwjblue yeah, that's what we did in blanket (required everything in the app directory)
wagenet commentedon Jul 1, 2016
I'd be happy to give this a shot.
adhamhf commentedon Jul 21, 2016
Is there a work around to get all files tested until a new release happens?
Also, would this also include .hbs files? I'm noting their is logic them that is not necessarily getting covered....
sglanzer-fire commentedon Jul 25, 2016
Coverage typically would include .hbs files, but the mapping is based on compiled templates (HTMLbars), so it doesn't always look pretty ;)
sglanzer-fire commentedon Jul 25, 2016
@wagenet did you get anywhere on this? I have a few devs that are going to start picking up the work around addon testing and we could take a look at this as well
wagenet commentedon Jul 27, 2016
@sglanzer didn't end up getting beyond a hack in my own app.
wagenet commentedon Jul 28, 2016
I added the following to my
tests/index.htmlafter the<script src="assets/test-loader.js"></script>line.(
direwolfis the app's name.)sglanzer-fire commentedon Jul 28, 2016
@EWhite613 is going to start picking up some of this work - pinging him here to start involvement
Also @wagenet wins the app name of the month - I would want to work on a project with a name like that 👍
fotinakis commentedon Aug 8, 2016
Happy to beta test this when ready — I just switched a large Ember app from
ember-cli-blanketto this addon, coverage jumped from 55% to 85% due to this issue.benoror commentedon Aug 9, 2016
+1 same here
On Mon, Aug 8, 2016, 18:15 Mike Fotinakis notifications@github.com wrote:
_Ben Orozco_Website: benoror.com
Appointments: vyte.in/benoror
EWhite613 commentedon Aug 10, 2016
I got to the point where I basically store file patterns in
config/coverage.jsand would read in the files, but was never able to produce a coverage object (Istanbul's api documentation leaves something to be desired)so I could add it to the coverage report.My only working solution was to merge the untested broccoli trees in, but I wasn't happy with that approach.
mike183 commentedon Aug 12, 2016
I'm also running into this issue, I currently have an application with 0 tests (I know...terrible), but it's reporting back as 100% code coverage! 😅
fotinakis commentedon Aug 12, 2016
This is how blanket-require.js does it, apparently:
https://github.com/sglanzer/ember-cli-blanket/blob/e7e80913b10e8b38863ff57a0cfa3c41daa2c810/vendor/blanket-require.js#L103
sglanzer-fire commentedon Aug 12, 2016
We're funky like that - just not sure if those concepts carry forward into the best practice version of a code coverage addon - someone else will need to make that call, my brain hasn't been in this space for a while
fotinakis commentedon Aug 12, 2016
👍 I like it, I'm up for anything that fixes this. :)
wagenet commentedon Aug 12, 2016
@sglanzer it's the code name for https://www.skylight.io :)
sglanzer-fire commentedon Aug 13, 2016
I'll try to find some time next week to sync with @rwjblue and @kategengler - probably should put together a roadmap for this and the addon coverage issues
lolmaus commentedon Nov 1, 2016
@rwjblue @wagenet @kategengler You rock!