mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
fc3bd58edd
* 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
24 lines
749 B
JavaScript
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);
|