Skip to content

Commit ede4aeb

Browse files
committed
test(config-resolver): add mock for regionRegex
1 parent be00b8d commit ede4aeb

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

packages/config-resolver/src/regionInfo/getHostnameTemplate.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const AWS_TEMPLATE = "{signingService}.{region}.amazonaws.com";
88
describe(getHostnameTemplate.name, () => {
99
const mockRegion = "mockRegion";
1010
const mockPartition = "mockPartition";
11+
const mockRegionRegex = "mockRegionRegex";
1112
const mockHostname = "{region}.mockHostname.com";
1213
const mockSigningService = "mockSigningService";
1314

@@ -24,6 +25,7 @@ describe(getHostnameTemplate.name, () => {
2425
const mockPartitionHash: PartitionHash = {
2526
[mockPartition]: {
2627
regions: [mockRegion, `${mockRegion}2`, `${mockRegion}3`],
28+
regionRegex: mockRegionRegex,
2729
hostname: mockHostname,
2830
},
2931
};

packages/config-resolver/src/regionInfo/getRegionInfo.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ describe(getRegionInfo.name, () => {
1010
const mockSigningService = "mockSigningService";
1111

1212
const mockRegion = "mockRegion";
13+
const mockRegionRegex = "mockRegionRegex";
1314
const mockHostname = "{region}.mockHostname.com";
1415
const mockEndpointRegion = "mockEndpointRegion";
1516
const mockEndpointHostname = "{region}.mockEndpointHostname.com";
@@ -36,6 +37,7 @@ describe(getRegionInfo.name, () => {
3637
const getMockPartitionHash = (regionCase: RegionCase): PartitionHash => ({
3738
[mockPartition]: {
3839
regions: [mockRegion, `${mockRegion}2`, `${mockRegion}3`],
40+
regionRegex: mockRegionRegex,
3941
...((regionCase === RegionCase.REGION || regionCase === RegionCase.REGION_AND_ENDPOINT) && {
4042
hostname: mockHostname,
4143
}),

packages/config-resolver/src/regionInfo/getResolvedHostname.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ describe(getResolvedHostname.name, () => {
88
const mockSigningService = "mockSigningService";
99
const mockRegion = "mockRegion";
1010
const mockPartition = "mockPartition";
11+
const mockRegionRegex = "mockRegionRegex";
1112
const mockHostname = "{region}.mockHostname.com";
1213

1314
afterEach(() => {
@@ -40,6 +41,7 @@ describe(getResolvedHostname.name, () => {
4041
const mockPartitionHash: PartitionHash = {
4142
[mockPartition]: {
4243
regions: [mockRegion, `${mockRegion}2`, `${mockRegion}3`],
44+
regionRegex: mockRegionRegex,
4345
hostname: mockHostname,
4446
},
4547
};

packages/config-resolver/src/regionInfo/getResolvedPartition.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ describe(getResolvedPartition.name, () => {
44
const mockRegion = "mockRegion";
55
const mockPartition = "mockPartition";
66
const mockHostname = "mockHostname";
7+
const mockRegionRegex = "mockRegionRegex";
78

89
it("returns the partition if region is present in partitionHash", () => {
910
const mockPartitionHash: PartitionHash = {
1011
[mockPartition]: {
1112
regions: [mockRegion, `${mockRegion}2`, `${mockRegion}3`],
13+
regionRegex: mockRegionRegex,
1214
hostname: mockHostname,
1315
},
1416
};
@@ -19,6 +21,7 @@ describe(getResolvedPartition.name, () => {
1921
const mockPartitionHash: PartitionHash = {
2022
[`${mockPartition}2`]: {
2123
regions: [`${mockRegion}2`, `${mockRegion}3`],
24+
regionRegex: mockRegionRegex,
2225
hostname: mockHostname,
2326
},
2427
};

0 commit comments

Comments
 (0)