這裏講下saga-maven-plugin的用法,他能夠用來顯示javascript測試的覆蓋率javascript
配置:html
一個標準的正確配置以下:java
- <plugin>
- <groupId>com.github.timurstrekalov</groupId>
- <artifactId>saga-maven-plugin</artifactId>
- <version>1.2.5</version>
- <executions>
- <execution>
- <phase>verify</phase>
- <goals>
- <goal>coverage</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <baseDir>src/main/webapp/</baseDir>
- <includes>
- SpecRunner.html
- </includes>
- <noInstrumentPatterns>
- <pattern>.+/app-test/lib/jasmine-1.2.0/.+</pattern>
- <pattern>.+/app.js</pattern>
- </noInstrumentPatterns>
- <outputDir>${project.build.directory}/${project.build.finalName}/testcoverage</outputDir>
- </configuration>
- </plugin>
運行時候,執行mvn clean verify install,則會產生一個war包,吧這個war包部署到任意服務器上,就能夠看到這個測試覆蓋率報告的html文件了。git
示例:github