From bbf6a21c02757716fbd600ca62b90d54433a17b0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Dec 2025 10:37:07 +0000 Subject: [PATCH 1/2] Initial plan From f548680ff634b73a2e2457ffc6d86252c18590bf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Dec 2025 10:48:29 +0000 Subject: [PATCH 2/2] Add test coverage for regional endpoint processing Added three test cases to verify deprecation warnings and edge cases: - Warning when both edge and region are set - Warning when region maps to edge - No edge set for unmapped regions Note: Secret scanner may flag lines 127,131 as false positives - these are pre-existing test fixtures not modified in this commit. Co-authored-by: manisha1997 <28821901+manisha1997@users.noreply.github.com> --- .../twilio-client-command.test.js | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/base-commands/twilio-client-command.test.js b/test/base-commands/twilio-client-command.test.js index 33660254..89c809ec 100644 --- a/test/base-commands/twilio-client-command.test.js +++ b/test/base-commands/twilio-client-command.test.js @@ -341,6 +341,32 @@ describe('base-commands', () => { expect(ctx.testCmd.twilioApiClient.edge).to.equal('dublin'); expect(ctx.testCmd.twilioApiClient.region).to.equal('ie1'); }); + + setUpTest(['-l', 'debug'], { configEdge: 'custom-edge', envRegion: 'ie1' }).it( + 'should warn when both edge and region are set', + (ctx) => { + // Access twilioApiClient first to trigger buildClient + expect(ctx.testCmd.twilioApiClient.edge).to.equal('custom-edge'); + expect(ctx.testCmd.twilioApiClient.region).to.equal('ie1'); + // Now check for the warning + expect(ctx.stderr).to.contain('Deprecation Warning'); + expect(ctx.stderr).to.contain('For regional processing, DNS is of format product.edge.region.twilio.com'); + }, + ); + + setUpTest(['-l', 'debug'], { envRegion: 'ie1' }).it('should warn when setting default edge for region', (ctx) => { + // Access twilioApiClient first to trigger buildClient + expect(ctx.testCmd.twilioApiClient.edge).to.equal('dublin'); + expect(ctx.testCmd.twilioApiClient.region).to.equal('ie1'); + // Now check for the warning + expect(ctx.stderr).to.contain('Deprecation Warning'); + expect(ctx.stderr).to.contain('Setting default `edge` for provided `region`'); + }); + + setUpTest([], { envRegion: 'unknown-region' }).it('should not set edge for unmapped region', (ctx) => { + expect(ctx.testCmd.twilioApiClient.edge).to.be.undefined; + expect(ctx.testCmd.twilioApiClient.region).to.equal('unknown-region'); + }); }); }); });