SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
teaching:labs:xp:2012b:testing-framework [2012/08/28 14:17]
tiberiu.budau
teaching:labs:xp:2012b:testing-framework [2018/05/09 01:59] (current)
Line 1: Line 1:
 +====== Testing Framework / Code Coverage ======
  
 +===== Testing =====
 +
 +  * We agreed upon Mocha, as it seems to be widely used and supports Code Coverage reports
 +    * [[http://​visionmedia.github.com/​mocha/​|Mocha Documentation]]
 +    * [[https://​github.com/​visionmedia/​mocha|Mocha on Github]]
 +
 +  * Installation
 +    * Prerequisite:​ Installed node.js/npm
 +    * Command: npm install -g mocha
 +
 +  * Running
 +    * Prerequisite:​ test.js in current folder
 +    * node [PATH TO NODE_MODULES]\mocha\bin\mocha
 +      * Example: node C:​\Users\molitor\AppData\Roaming\npm\node_modules\mocha\bin\mocha
 +  ​
 +  * Specification
 +    * All tests need to be located in a root folder '​test'​ (case sensitive) or any of its subfolders.
 +    * Only .js files are executed.
 +    * Use the <​nowiki>​--recursive</​nowiki>​ option to execute the entire test suite inside test.
 +    * Use <​nowiki>​--reporter</​nowiki>​ <​name>​ options for a differently structured output (including performance benchmarks).
 +      * <​nowiki>​--reporters</​nowiki>​ for all available reporter types 
 +      * Example: <​nowiki>​--reporter json</​nowiki>​
 +
 +===== Coverage =====
 +
 +  * Windows
 +    * Download JSCoverage: [[http://​siliconforks.com/​jscoverage/​download/​jscoverage-0.5.1-windows.zip]]
 +    * Extract it and move it to c:\agile
 +    * add the directory to the path

SEWiki, © 2019