Skip to content

Commit

Permalink
test: show diff when test:bin fails
Browse files Browse the repository at this point in the history
  • Loading branch information
nknapp committed Jan 8, 2020
1 parent d03b6ec commit d337f40
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"babel-runtime": "^5.1.10",
"benchmark": "~1.0",
"chai": "^4.2.0",
"chai-diff": "^1.0.1",
"concurrently": "^5.0.0",
"dirty-chai": "^2.0.1",
"dtslint": "^0.5.5",
Expand Down Expand Up @@ -84,7 +85,7 @@
"scripts": {
"format": "prettier --write '**/*.js' && eslint --fix .",
"check-format": "prettier --check '**/*.js'",
"lint": "eslint --max-warnings 0 . ",
"lint": "eslint --max-warnings 0 .",
"dtslint": "dtslint types",
"test": "grunt",
"extensive-tests-and-publish-to-aws": "npx mocha tasks/task-tests/ && grunt --stack extensive-tests-and-publish-to-aws",
Expand Down
13 changes: 8 additions & 5 deletions tasks/test-bin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
const childProcess = require('child_process'),
fs = require('fs'),
os = require('os'),
expect = require('chai').expect;
const childProcess = require('child_process');
const fs = require('fs');
const os = require('os');

const chai = require('chai');
chai.use(require('chai-diff'));
const expect = chai.expect;

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

expect(normalizedOutput).to.equal(normalizedExpectedOutput);
expect(normalizedOutput).not.to.be.differentFrom(normalizedExpectedOutput);
});
};

Expand Down

0 comments on commit d337f40

Please sign in to comment.