-
Notifications
You must be signed in to change notification settings - Fork 26
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
Support baseDir and instrumentFiles options #14
Conversation
…y the directory the JS files will be served from so it can remove those from the src file paths.
I was looking to update the tests as well to show a working example but I cannot get them to run currently so I omitted them. |
The pull request has been update to include the |
…n files for coverage based on your src files. It not supplied, it defaults to the context.scripts.src.
ping. can this get reviewed and considered to be merged in? Or at least commented that it won't? |
I haven't been very verbose the last few weeks, sorry for that. I didn't have internet access at home, and the weather was just too good to not spend the day nearby the river. But I have planned to look at your pull request and the issues to see what has been going on in that time and dive into this project again. |
The time goes way too fast... I had time to have a little look on the changes:
|
@maenu, thank for taking a look and responding.
It's not about fooling anyone. I (and I assume most others) don't want to include 3rd party libraries in coverage reports. I may use
This is be inadequately named. It doesn't load any instrumented sources. It massages the path to the source files so when they are served through connect that can be successfully loaded. Say you have a file on disk Now say that your connect server uses On disk |
This is exactly what I was looking for, I'm using various 3rd parties like YUI and I don't care about coverage on those files. |
@joseph-jja Well, you should include 3rd-party libraries in the |
@maenu what vendor option? Is this documented? |
@joseph-jja I'm speaking of jasmine's vendor option. This template only instruments the files in the src option. |
@maenu, ping. Have you had the time to reconsider the items in this pull request? |
@zdennis Snap, your pull request is like 4 months old and I still haven't found the time to inspect it entirely. Maybe I should get a calendar or something ;). I intend to add an option like The |
No worries, I know how it goes. I have a calendar and all it does is remind me how busy I am. :)
This sounds like more work. What if we start with the simpler case and then iterate and add the second report?
I can get behind this. I like your idea of allowing If I remove |
This was meant to be the description of a scenario how one could use the option. I don't think it would make sense to implement the option this way.
That would be awesome. |
This pull adds the
baseDir
andinstrumentFiles
options.baseDir
indicates the base directory that the JS will be served out of. This is useful when the JS files are found in a directory hierarchy on the file-system that doesn't match 1:1 with how the files are being served through connect.instrumentFiles
is a set of files (or file globs that grunt knows how to expand). When used these files will be the only ones that code coverage will be performed against.The example configuration (from a Gruntfile) below shows how this works:
The source files are found in the
site/
directory on the file-system but the connect server servers upsite/
as root so it's not necessary to keepsite/
in the generated src paths when the requireJS config gets read in, modified, and then written back out.And in the above configuration all JS files in the
site/js/vendor/
directory will be excluding from the code coverage report.