Commit a228e553 a228e5534f7b11c9a9d971f90c6edb010c4d6b49 by Julien Muetton

Implement `Tester.skip`

1 parent 3d5b91dd
......@@ -66,7 +66,9 @@ var Colorizer = function Colorizer() {
'GREEN_BAR': { fg: 'white', bg: 'green', bold: true },
'RED_BAR': { fg: 'white', bg: 'red', bold: true },
'INFO_BAR': { bg: 'cyan', fg: 'white', bold: true },
'WARN_BAR': { bg: 'yellow', fg: 'white', bold: true }
'WARN_BAR': { bg: 'yellow', fg: 'white', bold: true },
'SKIP': { fg: 'magenta', bold: true },
'SKIP_BAR': { bg: 'magenta', fg: 'black', bold: true }
};
/**
......
......@@ -222,6 +222,28 @@ Tester.prototype.abort = function abort(message) {
};
/**
* Aborts current test suite.
*
* @param {String} message Warning message (optional)
*/
Tester.prototype.skip = function skip(number, message) {
"use strict";
var step = this.casper.step,
steps = this.casper.steps,
last = steps.length;
if (message) {
this.casper.echo([
this.casper.colorize('SKIP', 'SKIP'),
'test suite aborted: ' + message
].join(' '));
}
this.casper.step = Math.min(step + number, last);
return this;
};
/**
* Asserts that a condition strictly resolves to true. Also returns an
* "assertion object" containing useful informations about the test case
* results.
......