How to implement coverage in a maven-like fashion?

25 views
Skip to first unread message

David Karr

unread,
May 10, 2013, 5:03:14 PM5/10/13
to js-test...@googlegroups.com
I have a simple use of jstestdriver using the Maven plugin.  I'm trying to generate coverage data now.  I'm hoping this can be done with Maven in a way that is at least somewhat reasonable.

I'm seeing some possibly conflicting information about how to set this up.

The Maven plugin documentation doesn't have any information.

The main jsTestDriver wiki has two pages that seem to conflict with each other.

On http://code.google.com/p/js-test-driver/wiki/CommandLineFlags it mentions:

"--plugins VAL[,VAL]       : Comma separated list of paths to plugin jars."

I tried using this method, but when I run my test, I get errors like this:


com.google.inject.CreationException: Guice creation errors:

1) No implementation for com.google.jstestdriver.JsTestDriverServer$Factory was bound.
  while locating com.google.jstestdriver.JsTestDriverServer$Factory
    for parameter 4 at com.google.jstestdriver.ActionFactory.<init>(ActionFactory.java:56)
  while locating com.google.jstestdriver.ActionFactory
    for parameter 0 at com.google.jstestdriver.guice.DefaultBrowserActionProvider.<init>(DefaultBrowserActionProvider.java:51)
  while locating com.google.jstestdriver.guice.DefaultBrowserActionProvider
    for parameter 1 at com.google.jstestdriver.coverage.CoverageThreadedActionProvider.<init>(CoverageThreadedActionProvider.java:25)
  at com.google.jstestdriver.coverage.CoverageModule.configure(CoverageModule.java:66)


On http://code.google.com/p/js-test-driver/wiki/CodeCoverage it talks about copying the coverage jar into the "plugins" subdirectory of the jsTestDriver installation.  This seems to be incompatible with using the jsTestDriver Maven plugin. In addition, I have to reference the plugin in the "jsTestDriver.conf" file with a relative path.  I was wondering whether it's possible for this to be an absolute path, which might avoid the problem of having to copy the coverage jar into the "plugins" subdirectory.  I'd then want to have this file store a reference to a Maven property (whose value would be in ~/.m2/settings.xml) and then use Maven property filtering to produce the file used at run time.

Reply all
Reply to author
Forward
0 new messages