Features
| Feature | Screenshot |
|---|---|
| Unit test and code coverage reports with JsTestDriver | |
Code metrics:
|
Usage & Installation
Installation
- Install JavaScript plugin through Update Center
- Restart Sonar
Analysis with Maven
Create a maven pom for your project and run "mvn sonar:sonar" to run analysis and import JsTestDriver results
Sample JavaScript project analysis with Maven
Checkout http://javascript-plugin-for-sonar.googlecode.com/svn/trunk/sample
Update <browser> in pom.xml to point to browser where JavaScript unit tests should be run
- Run "mvn test" to execute JsTestDriver unit tests and gather code coverage statistics
- Run "mvn sonar:sonar" to analyse JavaScript code and import unit test results
Analysis with simple Java runner
- Download latest version of Simple Java Runner
- Create sonar-project.properties file for your project
Sample JavaScript project analysis with Simple Java Runner
Checkout https://javascript-plugin-for-sonar.googlecode.com/svn/trunk/sample-simple-runner
Change "<base_dir>" placeholders to actual path in sample JsTestDriver coverage file "jstestdriver/jsTestDriver.conf-coverage.dat"
- Run "sonar-runner"
Unit Tests and Code Coverage Reports
Unit test and code coverage reports produced by JsTestDriver. Integrated through jstd-maven-plugin.
Changelog
| Release 0.4 (5 issues) | |||||
|---|---|---|---|---|---|
| Type | Key | Summary | Priority | Status | Resolution |
|
|
SONARPLUGINS-1625 | NullPointer on loading test file |
|
|
Fixed |
|
|
SONARPLUGINS-1587 | Support of JsTestDriver unit test execution and code coverage reports should be added |
|
|
Fixed |
|
|
SONARPLUGINS-1319 | Doesn't work with SCM Plugin |
|
|
Fixed |
|
|
SONARPLUGINS-1295 | Cannot specify sonar.javascript.lslint.predef in POM |
|
|
Fixed |
|
|
SONARPLUGINS-1139 | Cannot define multiple predefined variables |
|
|
Fixed |
| Release 0.3 (1 issues) | |||||
|---|---|---|---|---|---|
| Type | Key | Summary | Priority | Status | Resolution |
|
|
SONARPLUGINS-1006 | Migrate JavaScript plugin from code.google.com to Codehaus |
|
|
Fixed |
Roadmap Ideas
- Add support for Jasmine


