Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

a maven plugin for JSCover for a simple use case: generate coverage in conjunction of the jasmine-maven-plugin

License

Notifications You must be signed in to change notification settings

digitalfondue/jscoverproxy-maven-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jscoverproxy-maven-plugin

Maven Central

A maven plugin for replacing saga-maven-plugin, as it does not generate the correct coverage anymore when used with the jasmine-maven-plugin.

It's powered by JSCover project.

Example of use:

See: http://searls.github.io/jasmine-maven-plugin/code-coverage.html : replace the plugin block for saga-maven-plugin with:

<plugin>
	<groupId>ch.digitalfondue.jscover</groupId>
	<artifactId>jscoverproxy-maven-plugin</artifactId>
	<version>2.0.2.1</version>
	<executions>
		<execution>
			<goals>
				<goal>coverage</goal>
			</goals>
		</execution>
	</executions>
	<configuration>
		<baseUrl>http://localhost:${jasmine.serverPort}</baseUrl>
		<outputDir>${project.build.directory}/report/</outputDir>
		<noInstruments>
			<noInstrument>webjars/</noInstrument>
			<noInstrument>classpath/</noInstrument>
			<noInstrument>spec/</noInstrument>
		</noInstruments>
		<jsSrcDir>src/main/webapp/app</jsSrcDir><!-- mandatory for LCOV and  COBERTURAXML -->
		<generateXMLSUMMARY>true</generateXMLSUMMARY><!-- optional -->
		<generateLCOV>true</generateLCOV><!-- optional -->
		<generateCOBERTURAXML>true</generateCOBERTURAXML><!-- optional -->
		<timeout>60</timeout> <!-- default 60 seconds -->
		<!-- optionals:
		<includeUnloadedJS>true</includeUnloadedJS>
		<detectCoalesce>true</detectCoalesce>
		<removeJsSnippets>
		    <removeJsSnippet>alert('tests');</removeJsSnippet> 
		</removeJsSnippets>
		--><!-- you can remove js code if it cause issues -->
	</configuration>
</plugin>

for additional instrumentation configuration, use instead of "<noInstruments>":

<instrumentPathArgs>
    <arg>--no-instrument=webjars/</arg>
    <arg>--no-instrument=classpath/</arg>
    <arg>--no-instrument=spec/</arg>
</instrumentPathArgs>

you can also use: --no-instrument-reg= and --only-instrument-reg=

About

a maven plugin for JSCover for a simple use case: generate coverage in conjunction of the jasmine-maven-plugin

Resources

License

Stars

Watchers

Forks

Packages

No packages published