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 d50e931 commit 992e242
Showing 1 changed file with 25 additions and 5 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();
});
});
});
});

0 comments on commit 992e242

Please sign in to comment.