Skip to content

Commit d337f40

Browse files
committedJan 8, 2020
test: show diff when test:bin fails
1 parent d03b6ec commit d337f40

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed
 

Diff for: ‎package-lock.json

+17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: ‎package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"babel-runtime": "^5.1.10",
3636
"benchmark": "~1.0",
3737
"chai": "^4.2.0",
38+
"chai-diff": "^1.0.1",
3839
"concurrently": "^5.0.0",
3940
"dirty-chai": "^2.0.1",
4041
"dtslint": "^0.5.5",
@@ -84,7 +85,7 @@
8485
"scripts": {
8586
"format": "prettier --write '**/*.js' && eslint --fix .",
8687
"check-format": "prettier --check '**/*.js'",
87-
"lint": "eslint --max-warnings 0 . ",
88+
"lint": "eslint --max-warnings 0 .",
8889
"dtslint": "dtslint types",
8990
"test": "grunt",
9091
"extensive-tests-and-publish-to-aws": "npx mocha tasks/task-tests/ && grunt --stack extensive-tests-and-publish-to-aws",

Diff for: ‎tasks/test-bin.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
const childProcess = require('child_process'),
2-
fs = require('fs'),
3-
os = require('os'),
4-
expect = require('chai').expect;
1+
const childProcess = require('child_process');
2+
const fs = require('fs');
3+
const os = require('os');
4+
5+
const chai = require('chai');
6+
chai.use(require('chai-diff'));
7+
const expect = chai.expect;
58

69
module.exports = function(grunt) {
710
grunt.registerTask('test:bin', function() {
@@ -18,7 +21,7 @@ module.exports = function(grunt) {
1821
const normalizedOutput = normalizeCrlf(stdout);
1922
const normalizedExpectedOutput = normalizeCrlf(expectedOutput);
2023

21-
expect(normalizedOutput).to.equal(normalizedExpectedOutput);
24+
expect(normalizedOutput).not.to.be.differentFrom(normalizedExpectedOutput);
2225
});
2326
};
2427

0 commit comments

Comments
 (0)
Please sign in to comment.