Karma Coverage detail not shown if location of test files is marked as excluded

I have a project wth a fair amount of transpiling goin on. Handlebars, stylus, etc...

I configured my project to watch my src directory and put transpiled output into dist and debug folders. I didnt want a bunch of generated files dirtying up my src directories...

I am running my unit tests out of the debug folder becuase it is the only location that has both the code as it will be shipped (transpiled) and dependencies satisfied in the same manner as they are when deployed to production.

Everything works great except the webstorm UI does not show the coverage % in the coverage plugin. I tracked it down to the debug folder being marked as "excluded". If I remove the exclusion, the coverage % appears as expected in the UI. The reason I marked it as excluded is I do not want Webstorm to index anything in the build/debug folder.

Is there some other way to prevent indexing of files other than marking as excluded? or is it possible to tell Webstorm that even though the folder is excluded it is ok to pull coverage info out of it?

I'd be happy with a different configuration that prevents indexing transpiled files, a work around, or reporting a bug in the coverage plugin. Just looking for a little help from the community. Anyone had a similar situation?

Please don't reply with advice on using mocks and loose coupling etc. I am well aware of such things. My scenario does not allow me to mock a number of core dependencies.

Thanks,

Mike

2 comments
Comment actions Permalink
Is there some other way to prevent indexing of files other than marking as excluded? or is it possible to tell Webstorm that even though the folder is excluded it is ok to pull coverage info out of it?

No and no. Coverage information can't be shown for files that aren't indexed. And the only way to stop files/folders from being indexed is excluding them (individual files can also be marked as plain text - plain text files are not indexed)

0
Comment actions Permalink

Thanks Elena,

Not necessarily good news, but I expected my unique circumstance would come with a few issues.

I am going to see about configuring Karma to grab my src files from normal src location and see if I can get the dependencies to serve up from the debug folder... I also have requireJs in the mix so it might be tricky,or impossible. If I come up with a solution I'll post another reply in case it is helpful for someone else.

Thanks for the reply! :)

0

Please sign in to leave a comment.