From 82b93adf970e2e0d4cd10a6d272c9103b00ba76a Mon Sep 17 00:00:00 2001 From: sburman Date: Sun, 19 Nov 2023 18:42:01 +0530 Subject: [PATCH] Update client.spec.js --- packages/client/src/client.spec.js | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/packages/client/src/client.spec.js b/packages/client/src/client.spec.js index 875564252..935988933 100644 --- a/packages/client/src/client.spec.js +++ b/packages/client/src/client.spec.js @@ -26,14 +26,6 @@ describe('client', () => { nock.cleanAll(); }); - describe('setDataResidency', () => { - sgClient.setDataResidency('eu'); - console.log('Actual:', sgClient.defaultRequest.baseUrl); - it('should have hostname as global', () => { - expect(sgClient.defaultRequest.baseUrl).to.equal('api.eu.sendgrid.com'); - }); - }); - describe('setApiKey', () => { it('should not log a warning for a proper API key value', () => { sgClient.setApiKey('SG.1234567890'); @@ -3100,3 +3092,23 @@ describe('test_whitelabel_links__link_id__subuser_post', () => { return testRequest(request, 200); }); }); + + +describe('test client', () => { + const testClient = require('./client'); + + afterEach(() => { + console.warn.restore(); + nock.cleanAll(); + }); + + describe('setDataResidency', () => { + testClient.setDataResidency('eu'); + console.log('Actual:', testClient.defaultRequest.baseUrl); + it('should have hostname as global', () => { + console.log(testClient); + expect(testClient.defaultRequest.baseUrl).to.equal('api.eu.sendgrid.com'); + }); + }); +}); +