accounted for non-terminal output, closes #110
This commit is contained in:
parent
30ad17e4bc
commit
5ecc8fd961
@ -1,4 +1,4 @@
|
|||||||
# grunt-contrib-jasmine [![Build Status](https://travis-ci.org/gruntjs/grunt-contrib-jasmine.png?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-jasmine)
|
# grunt-contrib-jasmine v0.6.0 [![Build Status](https://travis-ci.org/gruntjs/grunt-contrib-jasmine.png?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-jasmine)
|
||||||
|
|
||||||
> Run jasmine specs headlessly through PhantomJS.
|
> Run jasmine specs headlessly through PhantomJS.
|
||||||
|
|
||||||
@ -266,4 +266,4 @@ for more information on the RequireJS template.
|
|||||||
|
|
||||||
Task submitted by [Jarrod Overson](http://jarrodoverson.com)
|
Task submitted by [Jarrod Overson](http://jarrodoverson.com)
|
||||||
|
|
||||||
*This file was generated on Wed Jan 29 2014 08:51:54.*
|
*This file was generated on Thu Jan 30 2014 12:05:09.*
|
||||||
|
@ -153,6 +153,7 @@ module.exports = function(grunt) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
phantomjs.on('console', function(msg) {
|
phantomjs.on('console', function(msg) {
|
||||||
|
thisRun.cleanConsole = false;
|
||||||
grunt.log.writeln('\n' + chalk.yellow('log: ') + msg);
|
grunt.log.writeln('\n' + chalk.yellow('log: ') + msg);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -205,7 +206,8 @@ module.exports = function(grunt) {
|
|||||||
|
|
||||||
phantomjs.on('jasmine.specStarted', function(specMetaData) {
|
phantomjs.on('jasmine.specStarted', function(specMetaData) {
|
||||||
thisRun.executedSpecs++;
|
thisRun.executedSpecs++;
|
||||||
grunt.log.write(indent(indentLevel) + '- ' + chalk.grey(specMetaData.description));
|
thisRun.cleanConsole = true;
|
||||||
|
grunt.log.write(indent(indentLevel) + '- ' + chalk.grey(specMetaData.description) + '...');
|
||||||
});
|
});
|
||||||
|
|
||||||
phantomjs.on('jasmine.specDone', function(specMetaData) {
|
phantomjs.on('jasmine.specDone', function(specMetaData) {
|
||||||
@ -241,14 +243,29 @@ module.exports = function(grunt) {
|
|||||||
|
|
||||||
suites[currentSuite].testcases.push(specSummary);
|
suites[currentSuite].testcases.push(specSummary);
|
||||||
|
|
||||||
process.stdout.clearLine();
|
// If we're writing to a proper terminal, make it fancy.
|
||||||
process.stdout.cursorTo(0);
|
if (process.stdout.clearLine) {
|
||||||
|
process.stdout.clearLine();
|
||||||
grunt.log.writeln(
|
process.stdout.cursorTo(0);
|
||||||
indent(indentLevel) +
|
grunt.log.writeln(
|
||||||
chalk[color].bold(symbols[symbol]) + ' ' +
|
indent(indentLevel) +
|
||||||
chalk.grey(specMetaData.description)
|
chalk[color].bold(symbols[symbol]) + ' ' +
|
||||||
);
|
chalk.grey(specMetaData.description)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// If we haven't written out since we've started
|
||||||
|
if (thisRun.cleanConsole) {
|
||||||
|
// then append to the current line.
|
||||||
|
grunt.log.writeln('...' + symbols[symbol]);
|
||||||
|
} else {
|
||||||
|
// Otherwise reprint the current spec and status.
|
||||||
|
grunt.log.writeln(
|
||||||
|
indent(indentLevel) + '...' +
|
||||||
|
chalk.grey(specMetaData.description) + '...' +
|
||||||
|
symbols[symbol]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
specMetaData.failedExpectations.forEach(function(error, i){
|
specMetaData.failedExpectations.forEach(function(error, i){
|
||||||
var specIndex = ' ('+(i+1)+')';
|
var specIndex = ' ('+(i+1)+')';
|
||||||
|
Loading…
Reference in New Issue
Block a user