In my JS Test Driver configuration file, I’m excluding unit tests from code coverage calculation by putting them under test instead of load.
However, I can’t do this for dependencies, like jQuery of Underscore.js, since they need to be loaded before my code.
Is there any way around this? Or do I just deal with the slow code coverage runs and statistic clutter?
Solution 1:
There’s a way using the ´args´ parameter as Greg says, but that way unfortunately you have to specify the full path, as this (asuming Windows):
For linux filesystems, you don’t have to use double slash.
Solution 2:
There’s also a patched jar for 1.3.5 on this thread that allows you to exclude files that match a regular expression, so you’d have:
The
/js/lib/.*\.js$regex means “Exclude all the .js files located insidejs/lib“. (With this patch you don’t have to worry about Windows backslashes)I prefer this way much more, as it’s portable because it does not depend on a specific path for your application.
You can download the patched version here (look for Comment 11 in the thread).
Hope this helps.
Cheers, from La Paz-Bolivia