Merge pull request #133 from dubspeed/none_output

added 'none' as valid display option
This commit is contained in:
Vlad Filippov 2014-06-07 15:03:53 -07:00
commit a2f523d0de

View File

@ -28,6 +28,11 @@ module.exports = function(grunt) {
var summary = []; var summary = [];
var symbols = { var symbols = {
none : {
check : '',
error : '',
splat : ''
},
short : { short : {
check : '.', check : '.',
error : 'X', error : 'X',
@ -44,6 +49,11 @@ module.exports = function(grunt) {
//https://github.com/visionmedia/mocha/pull/641 //https://github.com/visionmedia/mocha/pull/641
if (process && process.platform === 'win32') { if (process && process.platform === 'win32') {
symbols = { symbols = {
none : {
check : '',
error : '',
splat : ''
},
short : { short : {
check : '.', check : '.',
error : '\u00D7', error : '\u00D7',
@ -299,9 +309,12 @@ module.exports = function(grunt) {
// If we haven't written out since we've started // If we haven't written out since we've started
if (thisRun.cleanConsole) { if (thisRun.cleanConsole) {
// then append to the current line. // then append to the current line.
if (options.display !== 'none') {
grunt.log.writeln('...' + symbols[options.display][symbol]); grunt.log.writeln('...' + symbols[options.display][symbol]);
}
} else { } else {
// Otherwise reprint the current spec and status. // Otherwise reprint the current spec and status.
if (options.display !== 'none') {
grunt.log.writeln( grunt.log.writeln(
indent(indentLevel) + '...' + indent(indentLevel) + '...' +
chalk.grey(specMetaData.description) + '...' + chalk.grey(specMetaData.description) + '...' +
@ -309,6 +322,7 @@ module.exports = function(grunt) {
); );
} }
} }
}
specMetaData.failedExpectations.forEach(function(error, i){ specMetaData.failedExpectations.forEach(function(error, i){
var specIndex = ' ('+(i+1)+')'; var specIndex = ' ('+(i+1)+')';