Skip to content

Commit

Permalink
fixup no-diff tests to use expect.js for #2536
Browse files Browse the repository at this point in the history
  • Loading branch information
boneskull committed Dec 12, 2017
1 parent cbdb02e commit 179669e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
30 changes: 25 additions & 5 deletions test/integration/no-diff.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,31 @@ var helpers = require('./helpers');
var run = helpers.runMocha;

describe('no-diff', function () {
it('should be honoured', function (done) {
run('no-diff.fixture.js', ['--no-diff'], function (err, res) {
res.output.should.not.match(/\+ expected/);
res.output.should.not.match(/- actual/);
done(err);
describe('when enabled', function () {
it('should not display a diff', function (done) {
run('no-diff.fixture.js', ['--no-diff'], function (err, res) {
if (err) {
done(err);
return;
}
expect(res.output).not.to.match(/\+ expected/);
expect(res.output).not.to.match(/- actual/);
done();
});
});
});

describe('when disabled', function () {
it('should display a diff', function (done) {
run('no-diff.fixture.js', ['--diff'], function (err, res) {
if (err) {
done(err);
return;
}
expect(res.output).to.match(/\+ expected/);
expect(res.output).to.match(/- actual/);
done();
});
});
});
});
4 changes: 2 additions & 2 deletions test/reporters/base.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ describe('Base reporter', function () {
Base.hideDiff = false; // Revert to original value

errOut = stdout.join('\n');
errOut.should.not.match(/\- actual/);
errOut.should.not.match(/\+ expected/);
expect(errOut).to.not.match(/- actual/);
expect(errOut).to.not.match(/\+ expected/);
});
});

Expand Down

0 comments on commit 179669e

Please sign in to comment.