Skip to content

Commit

Permalink
Assert for error code and message
Browse files Browse the repository at this point in the history
  • Loading branch information
gualopezb committed Mar 2, 2020
1 parent 7215d3f commit 290130c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@ These are the available config options for making requests. Only the `url` is re
// `maxContentLength` defines the max size of the http response content in bytes allowed
maxContentLength: 2000,

// `maxBodyLength` defines the max size of the http request content in bytes allowed
// `maxBodyLength` (Node only option) defines the max size of the http request content in bytes allowed
maxBodyLength: 2000,

Expand Down
3 changes: 3 additions & 0 deletions test/unit/adapters/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,12 @@ describe('supports http with nodejs', function () {
failure = true;
});


setTimeout(function () {
assert.equal(success, false, 'request should not succeed');
assert.equal(failure, true, 'request should fail');
assert.equal(error.code, 'ERR_FR_MAX_BODY_LENGTH_EXCEEDED');
assert.equal(error.message, 'Request body larger than maxBodyLength limit');
done();
}, 100);
});
Expand Down

0 comments on commit 290130c

Please sign in to comment.