mediawiki-extensions-Visual.../tests/parser/specs.js
Subramanya Sastry fc3bd58edd Added Jasmine specs to Parsoid.
* This is especially useful for running DOM -> wikitext tests.
* Run npm install to install dependencies.
* Add new specs in specs/ (see headings.spec.js for example).
* Run all specs with "node specs.js"
* With existing specs, this should fail one assertion.
  - The failing assertion is fixed in the bug-33089 branch.

Change-Id: I084868206a48ba6b69e6e3e85d94d0207a166ae0
2012-07-05 22:52:09 -05:00

24 lines
749 B
JavaScript

// Code copied from http://elegantcode.com/2011/03/07/taking-baby-steps-with-node-js-bdd-style-unit-tests-with-jasmine-node-sprinkled-with-some-should/
// and suitably adapted for our purposes
var jasmine = require('jasmine-node');
Object.keys(jasmine).forEach(function ( key ) {
global[key] = jasmine[key];
});
var isVerbose = true;
var showColors = true;
process.argv.slice(2).forEach(function(arg){
switch(arg) {
case '--color': showColors = true; break;
case '--no-color': showColors = false; break;
case '--no-verbose': isVerbose = false; break;
}
});
jasmine.executeSpecsInFolder(__dirname + '/specs', function(runner, log){
process.exit(runner.results().failedCount);
}, isVerbose, showColors);