saga-maven-plugin的用法

 

這裏講下saga-maven-plugin的用法,他能夠用來顯示javascript測試的覆蓋率javascript

 

配置:html

一個標準的正確配置以下:java

 

  
  
           
  
  
  1. <plugin> 
  2.  
  3.                          <groupId>com.github.timurstrekalov</groupId> 
  4.  
  5.                          <artifactId>saga-maven-plugin</artifactId> 
  6.  
  7.                          <version>1.2.5</version> 
  8.  
  9.                          <executions> 
  10.  
  11.                                   <execution> 
  12.  
  13.                                            <phase>verify</phase> 
  14.  
  15.                                            <goals> 
  16.  
  17.                                                    <goal>coverage</goal> 
  18.  
  19.                                            </goals> 
  20.  
  21.                                   </execution> 
  22.  
  23.                          </executions> 
  24.  
  25.                          <configuration> 
  26.  
  27.                                   <baseDir>src/main/webapp/</baseDir> 
  28.  
  29.                                   <includes> 
  30.  
  31.                                            SpecRunner.html 
  32.  
  33.                                   </includes> 
  34.  
  35.                                   <noInstrumentPatterns> 
  36.  
  37.                          <pattern>.+/app-test/lib/jasmine-1.2.0/.+</pattern> 
  38.  
  39.                          <pattern>.+/app.js</pattern> 
  40.  
  41.        </noInstrumentPatterns> 
  42.  
  43.                                   <outputDir>${project.build.directory}/${project.build.finalName}/testcoverage</outputDir> 
  44.  
  45.                          </configuration> 
  46.  
  47. </plugin> 

 

運行時候,執行mvn clean verify install,則會產生一個war包,吧這個war包部署到任意服務器上,就能夠看到這個測試覆蓋率報告的html文件了。git

 

示例:github

相關文章
相關標籤/搜索