Skip to content

Commit

Permalink
tests cover onto utils.implicityReturnValues
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNorthMemory committed Jun 26, 2021
1 parent 0729e20 commit a11991d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ utils.extend(utils, {
* @param {string|object|any} response - the response
* @param {string[]|int[]} ...params - the params
*
* @return {Error} - The customized Error
* @return {AssertionError} - The customized AssertionError
*/
implicityReturnValues(message, response, ...params) {
const error = new AssertionError({ message: format(message, ...params) });
Expand Down
12 changes: 12 additions & 0 deletions tests/lib/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,16 @@ describe('lib/utils', () => {
utils.isStream(new Multipart.FormData()).should.be.a.Boolean().and.be.True();
});
});

describe('utils::implicityReturnValues', () => {
it('method `implicityReturnValues` should be function', () => {
should(utils.implicityReturnValues).be.a.Function();
});

it('method `implicityReturnValues` should returns an Error instance with `response` property', () => {
const err = utils.implicityReturnValues();
err.should.be.instanceof(Error).and.have.property('code', 'ERR_ASSERTION');
err.should.have.property('response');
});
});
});

0 comments on commit a11991d

Please sign in to comment.