Created
December 8, 2017 03:38
-
-
Save aitchkhan/db6907e9b7eea4cff57b3153871dcc44 to your computer and use it in GitHub Desktop.
Here is a sample test written with mocha + chai + sinon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('Error case(s)', () => { | |
it('should return type required error', (done) => { | |
repos.favorites.contentIdsCount.resolves(contentIdsCountResponse); | |
expect(services.aggregates.view({skip: 0, pageSize: 15, type: 'randomType'})) | |
.to.eventually.be.rejected.and.be.an.instanceOf(errorHelper.BadRequestError) | |
.and.eventually.deep.equal(new errorHelper.BadRequestError([messages.validation.aggregateType.enum])) | |
.notify(done); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment