From 1123e030445c2e327e35de490bc57336c6ea550b Mon Sep 17 00:00:00 2001 From: Jarrod Overson Date: Thu, 27 Feb 2014 14:02:10 -0800 Subject: [PATCH] separated long vs short symbols --- tasks/jasmine.js | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/tasks/jasmine.js b/tasks/jasmine.js index 459a09e..4271ce4 100644 --- a/tasks/jasmine.js +++ b/tasks/jasmine.js @@ -26,18 +26,32 @@ module.exports = function(grunt) { var status = {}; var symbols = { - check : '✓', - error : 'X', - splat : '*' + short : { + check : '.', + error : 'X', + splat : '*' + }, + long : { + check : '✓', + error : 'X', + splat : '*' + } }; //With node.js on Windows: use symbols available in terminal default fonts //https://github.com/visionmedia/mocha/pull/641 if (process && process.platform === 'win32') { symbols = { - check : '\u221A', - error : '\u00D7', - splat : '*' + short : { + check : '.', + error : '\u00D7', + splat : '*' + }, + long : { + check : '\u221A', + error : '\u00D7', + splat : '*' + } }; } @@ -259,24 +273,24 @@ module.exports = function(grunt) { process.stdout.cursorTo(0); grunt.log.writeln( indent(indentLevel) + - chalk[color].bold(symbols[symbol]) + ' ' + + chalk[color].bold(symbols.long[symbol]) + ' ' + chalk.grey(specMetaData.description) ); } else if(options.display === 'short') { process.stdout.moveCursor(-1); - grunt.log.write(chalk[color].bold(symbols[symbol])); + grunt.log.write(chalk[color].bold(symbols.short[symbol])); } } 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]); + grunt.log.writeln('...' + symbols[options.display][symbol]); } else { // Otherwise reprint the current spec and status. grunt.log.writeln( indent(indentLevel) + '...' + chalk.grey(specMetaData.description) + '...' + - symbols[symbol] + symbols[options.display][symbol] ); } } @@ -318,7 +332,7 @@ module.exports = function(grunt) { function logSummary(tests) { grunt.log.writeln('Summary (' + tests.length + ' tests failed)'); _.forEach(tests, function(test){ - grunt.log.writeln(chalk.red(symbols['error']) + ' ' + test.name); + grunt.log.writeln(chalk.red(symbols[options.display]['error']) + ' ' + test.name); _.forEach(test.errors, function(error){ grunt.log.writeln(' ' + chalk.red(error.message)); });