From dbfb6c43847f178f56bd70cd11270d8d56ff9be3 Mon Sep 17 00:00:00 2001 From: Bruno Pinto Date: Fri, 28 Jan 2022 12:35:35 -0300 Subject: [PATCH] Fix StripeResource to successfully import TIMEOUT_ERROR_CODE. --- lib/StripeResource.js | 2 +- test/StripeResource.spec.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/StripeResource.js b/lib/StripeResource.js index e16bd90120..c9acf3f41a 100644 --- a/lib/StripeResource.js +++ b/lib/StripeResource.js @@ -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; diff --git a/test/StripeResource.spec.js b/test/StripeResource.spec.js index f3d4600ad3..e84937cc5f 100644 --- a/test/StripeResource.spec.js +++ b/test/StripeResource.spec.js @@ -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(); });