Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fastfrwrd committed Jul 23, 2016
1 parent 3b00a6a commit 8aa5379
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,17 @@ describe('chaiMoment.setErrorFormat', function() {
});

it('sets the moment.format() call for an error', function() {
chaiMoment.setErrorFormat('L');
var testFormats = ['L', 'LLL', 'D', 'mm:ss'];

function _errorThrower() {
assert.beforeMoment(oneYearLater, oneDayLater);
}
testFormats.forEach(function(format) {
chaiMoment.setErrorFormat(format);

function _errorThrower() {
assert.beforeMoment(oneYearLater, oneDayLater);
}

expect(_errorThrower).to.throw(oneYearLater.format('LL'));
expect(_errorThrower).to.throw(oneDayLater.format('LL'));
expect(_errorThrower).to.throw(oneYearLater.format(format));
expect(_errorThrower).to.throw(oneDayLater.format(format));
});
});
});

0 comments on commit 8aa5379

Please sign in to comment.