User Tools



JavaScript

The following sections provide information on using Testspace with popular JavaScript test frameworks and tools.

To push the collected result files to Testspace simply use the following client command line:

testspace static-analysis-results test-results code-coverage-results credentials@org-name.testspace.com/project-name/space-name 

where:

For more information on pushing results refer to the Collecting Data article.


Test Frameworks

Intern

Intern is a complete test stack for JavaScript.

Testspace accepts the JUnit XML formatted Test results. Here is an example of how to produce such:

intern-client reporters=junit

In the Testspace client command line reference report.xml as "test-results" file.

Jasmine

Jasmine is a Behavior Driven Development testing framework for JavaScript.

Testspace accepts the JUnit XML formatted Test results. To produce such the JUnitXmlReporter needs to be configured with your test runner. Assuming you are using Gulp JS build system and it configured to put the generated report files at ./reports, simply run your tests:

gulp test

or if running via jasmine-node

jasmine-node --junitreport --output=./reports

In the Testspace client command line reference ./reports/junitresults.xml as "test-results" file.

Mocha

Mocha is a feature-rich JavaScript test framework running on Node.js.

Testspace accepts the JUnit XML formatted Test results. To produce such the xunit-file reporter needs to be configured with your test runner. Assuming you are using Jake build system and it configured to put the generated report files at ./reports, simply run your tests:

jake test

or if running standalone

mocha --reporter xunit-file --reporter-options output=./reports/xunit.xml

In the Testspace client command line reference ./reports/xunit.xml as "test-results" file.

Node-tap

Node-tap is a TAP test framework for Node.js.

Testspace accepts the JUnit XML formatted Test results. Here is an example of how to produce such:

tap --reporter=xunit > ./reports/xunit.xml

In the Testspace client command line reference ./reports/xunit.xml as "test-results" file.

QUnit

QUnit is a powerful, easy-to-use JavaScript unit testing framework.

Testspace accepts the JUnit XML formatted Test results. To produce such the JUnit Reporter needs to be configured to log the XML string to report.xml file.

In the Testspace client command line reference report.xml as "test-results" file.


Code Coverage Tools

Intern

The Intern test framework has built-in support for code coverage.

Testspace accepts the Cobertura XML formatted results. Here is an example of how to produce such:

intern-client reporters=cobertura

In the Testspace client command line reference cobertura-coverage.xml as "code-coverage-results" file.

Istanbul

Istanbul is a code coverage tool for JavaScript.

Testspace accepts the Clover XML formatted results. Istanbul by default generates LCOV-style reports but could be directed to generate the desired XML Report. Here is an example of how to produce such:

istanbul report clover

or if using nyc:

nyc report --reporter=clover

In the Testspace client command line reference ./coverage/clover.xml as "code-coverage-results" file.

JSCover

JSCover is a tool that measures code coverage for JavaScript programs.

Testspace accepts the Cobertura XML formatted results. JSCover by default generates JSON-style reports but could be directed to generate the desired XML Report. Here is an example of how to produce such:

java -cp JSCover-all.jar jscover.report.Main --format=COBERTURAXML ./

In the Testspace client command line reference ./cobertura-coverage.xml as "code-coverage-results" file.


Static Analysis Tools

ESLint

ESLint is a tool for identifying and reporting on patterns in JavaScript.

Testspace accepts Checkstyle XML formatted results. Here is an example of how to produce such:

eslint --format checkstyle --output-file analysis.xml  /path/to/source

In the Testspace client command line reference analysis.xml as "static-analysis-results" file.

JSHint

JSHint is a tool that detects errors and potential problems in JavaScript code.

Testspace accepts Checkstyle XML formatted results. Here is an example of how to produce such:

jshint --reporter=checkstyle /path/to/source > analysis.xml

In the Testspace client command line reference analysis.xml as "static-analysis-results" file.

TSLint

TSLint is an extensible static analysis tool that checks TypeScript code for readability, maintainability, and functionality errors.

Testspace accepts Checkstyle XML formatted results. Here is an example of how to produce such:

tslint --format=checkstyle --out=analysis.xml /path/to/source

In the Testspace client command line reference analysis.xml as "static-analysis-results" file.


Page Tools