Skip to content

Commit

Permalink
Update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rddimon committed Mar 5, 2024
1 parent 8f3e52a commit bbfebce
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
12 changes: 11 additions & 1 deletion test/unit-tests/aws/api-gateway-v1-wrapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,14 @@ describe("API Gateway V1 wrapper checks", () => {
restApiId: "test_rest_api_id",
basePath: "test",
stage: "test"
}, {
restApiId: "test_rest_api_id2",
basePath: "test2",
stage: "test"
}, {
restApiId: "test_rest_api_id3",
basePath: "test3",
stage: "dummy"
}]
});

Expand All @@ -348,8 +356,10 @@ describe("API Gateway V1 wrapper checks", () => {
}));

const actualResult = await apiGatewayV1Wrapper.getBasePathMappings(dc);
// should be filtered by stage
const expectedResult = [
new ApiGatewayMap("test_rest_api_id", "test", "test", null)
new ApiGatewayMap("test_rest_api_id", "test", "test", null),
new ApiGatewayMap("test_rest_api_id2", "test2", "test", null)
];

expect(actualResult).to.eql(expectedResult);
Expand Down
14 changes: 13 additions & 1 deletion test/unit-tests/aws/api-gateway-v2-wrapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,16 @@ describe("API Gateway V2 wrapper checks", () => {
ApiMappingKey: "test",
Stage: "test",
ApiMappingId: "test_id"
}, {
ApiId: "test_rest_api_id2",
ApiMappingKey: "test2",
Stage: "test",
ApiMappingId: "test_id2"
}, {
ApiId: "test_rest_api_id3",
ApiMappingKey: "test3",
Stage: "dummy",
ApiMappingId: "test_id3"
}]
});

Expand All @@ -381,8 +391,10 @@ describe("API Gateway V2 wrapper checks", () => {
}));

const actualResult = await apiGatewayV2Wrapper.getBasePathMappings(dc);
// should be filtered by stage
const expectedResult = [
new ApiGatewayMap("test_rest_api_id", "test", "test", "test_id")
new ApiGatewayMap("test_rest_api_id", "test", "test", "test_id"),
new ApiGatewayMap("test_rest_api_id2", "test2", "test", "test_id2")
];

expect(actualResult).to.eql(expectedResult);
Expand Down

0 comments on commit bbfebce

Please sign in to comment.