Skip to content

Commit c915bf6

Browse files
CCM-12875: Updated a test
1 parent 5c27813 commit c915bf6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lambdas/pdm-mock-api/src/__tests__/config.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,20 @@ describe('Config', () => {
105105
expect(service).toBeInstanceOf(ParameterStoreService);
106106
});
107107

108+
it('should use default AWS region when AWS_REGION not set', () => {
109+
delete process.env.AWS_REGION;
110+
const serviceWithDefaultRegion = new ParameterStoreService();
111+
expect(serviceWithDefaultRegion).toBeInstanceOf(ParameterStoreService);
112+
expect(serviceWithDefaultRegion.ssmClient).toBeDefined();
113+
});
114+
115+
it('should use AWS_REGION when set', () => {
116+
process.env.AWS_REGION = 'us-east-1';
117+
const serviceWithCustomRegion = new ParameterStoreService();
118+
expect(serviceWithCustomRegion).toBeInstanceOf(ParameterStoreService);
119+
expect(serviceWithCustomRegion.ssmClient).toBeDefined();
120+
});
121+
108122
it('should cache parameter values', async () => {
109123
const mockParameter = 'test-value';
110124
const mockSend = jest.fn().mockResolvedValue({

0 commit comments

Comments
 (0)