From 8ba74072d9fa787bf820d23faad3ba7e7fe27447 Mon Sep 17 00:00:00 2001 From: alexlamsl Date: Sat, 16 Apr 2016 22:33:29 +0800 Subject: [PATCH] improve readability of test failures --- Gruntfile.js | 2 +- tests/minifier.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 99984e6..7fb078a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -102,7 +102,7 @@ module.exports = function(grunt) { grunt.log.writeln(type + ' completed in ' + details.runtime + 'ms'); details.failures.forEach(function(details) { grunt.log.error(); - grunt.log.error(details.name); + grunt.log.error(details.name + (details.message ? ' [' + details.message + ']' : '')); grunt.log.error(details.source); grunt.log.error('Actual:'); grunt.log.error(details.actual); diff --git a/tests/minifier.js b/tests/minifier.js index 0ca58cf..c3df1b1 100644 --- a/tests/minifier.js +++ b/tests/minifier.js @@ -213,8 +213,10 @@ test('space normalization around text', function() { ['a b c', 'a b c'], ['a b c', 'a b c'] ].forEach(function(inputs) { - equal(minify(inputs[0], { collapseWhitespace: true }), inputs[1]); - equal(minify('
' + inputs[0] + '
', { collapseWhitespace: true }), '
' + inputs[1] + '
'); + equal(minify(inputs[0], { collapseWhitespace: true }), inputs[1], inputs[0]); + var input = '
' + inputs[0] + '
'; + var output = '
' + inputs[1] + '
'; + equal(minify(input, { collapseWhitespace: true }), output, input); }); equal(minify('

foo bar

', { collapseWhitespace: true }), '

foo bar

'); equal(minify('

foobar

', { collapseWhitespace: true }), '

foobar

'); -- 2.34.1