Skip to content

Commit

Permalink
Add test for displaying correct success total
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb531 committed May 12, 2017
1 parent 2a8d8e1 commit d9c14c3
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion test/spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ describe('rsvg-brunch', function () {
};
});

it('should display success message after all outputs finish', function (done) {
it('should display info message after all outputs finish', function (done) {
const loggySpy = getLoggySpy();
const ProxiedPlugin = proxyquire('../', {loggy: loggySpy});
const plugin = new ProxiedPlugin(defaultConfig);
Expand All @@ -232,6 +232,21 @@ describe('rsvg-brunch', function () {
}).catch(done);
});

it('should display correct total in info message', function (done) {
const loggySpy = getLoggySpy();
const ProxiedPlugin = proxyquire('../', {loggy: loggySpy});
const plugin = new ProxiedPlugin(defaultConfig);
// Ensure that default extendOutputProps does not prepend /public
// plugin.extendOutputProps;
conversion.output[1].height = 0;
const conversionPromise = plugin.handleConversion(conversion);
conversionPromise.then(() => {
sinon.assert.calledOnce(loggySpy.info);
sinon.assert.calledWith(loggySpy.info, sinon.match(/2 of 3/gi));
done();
}).catch(done);
});

});

describe('onCompile', function () {
Expand Down

0 comments on commit d9c14c3

Please sign in to comment.