Skip to content

Commit 52afae9

Browse files
committed
Improving multi task test gruntfile error output via difflet lib.
1 parent 549d183 commit 52afae9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"temporary": "~0.0.4",
6565
"grunt-contrib-jshint": "~0.1.0",
6666
"grunt-contrib-nodeunit": "~0.1.0",
67-
"grunt-contrib-watch": "~0.1.4"
67+
"grunt-contrib-watch": "~0.1.4",
68+
"difflet": "~0.2.3"
6869
}
6970
}

test/gruntfile/multi-task-files.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,13 +266,13 @@ module.exports = function(grunt) {
266266
};
267267

268268
var assert = require('assert');
269+
var difflet = require('difflet')({indent: 2, comment: true});
269270
var test = function(name, fn) {
270271
try {
271272
fn();
272273
} catch (err) {
273274
grunt.log.subhead('Assertion Failure in ' + name);
274-
console.log('Actual\n', JSON.stringify(err.actual, null, 2));
275-
console.log('Expected\n', JSON.stringify(err.expected, null, 2));
275+
console.log(difflet.compare(err.expected, err.actual));
276276
throw new Error(err.message);
277277
}
278278
};

0 commit comments

Comments
 (0)