Skip to content

Commit

Permalink
fix(http-client): use named import
Browse files Browse the repository at this point in the history
Custom request timeout message was never used since we were incorrectly
requiring the HttpClient class.

I believe this has stopped working on stripe#1218.
  • Loading branch information
bpinto committed Jan 21, 2022
1 parent 3172800 commit 08fb2d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/StripeResource.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const {
StripeAPIError,
} = require('./Error');

const HttpClient = require('./net/HttpClient');
const {HttpClient} = require('./net/HttpClient');

// Provide extension mechanism for Stripe Resource Sub-Classes
StripeResource.extend = utils.protoExtend;
Expand Down
3 changes: 3 additions & 0 deletions test/StripeResource.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ describe('StripeResource', () => {
}
stripe.charges.create(options.data, (err, result) => {
expect(err.detail.message).to.deep.equal('ETIMEDOUT');
expect(err.message).to.deep.equal(
'Request aborted due to timeout being reached (10ms)'
);
closeServer();
done();
});
Expand Down

0 comments on commit 08fb2d0

Please sign in to comment.