Skip to content

Commit 519d5e1

Browse files
committed
chore: address comments
1 parent 9af67c6 commit 519d5e1

File tree

52 files changed

+419
-664
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+419
-664
lines changed

clients/client-acm/test/acm-features.e2e.spec.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
import { getE2eTestResources } from "@aws-sdk/aws-util-test/src";
21
import { ACM } from "@aws-sdk/client-acm";
32
import { beforeAll, describe, expect, test as it } from "vitest";
43

5-
describe("@aws-sdk/client-acm", () => {
4+
describe(ACM.name, () => {
65
let client: ACM;
7-
let region: string;
86

97
beforeAll(async () => {
10-
const e2eTestResourcesEnv = await getE2eTestResources();
11-
Object.assign(process.env, e2eTestResourcesEnv);
12-
13-
region = process?.env?.AWS_SMOKE_TEST_REGION as string;
14-
15-
client = new ACM({ region });
8+
client = new ACM({ region: "us-west-2" });
169
});
1710

1811
describe("Making a request to ACM service", () => {

clients/client-api-gateway/test/apigateway-features.e2e.spec.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
import { getE2eTestResources } from "@aws-sdk/aws-util-test/src";
21
import { APIGateway } from "@aws-sdk/client-api-gateway";
32
import { beforeAll, describe, expect, test as it } from "vitest";
43

5-
describe("@aws-sdk/client-api-gateway", () => {
4+
describe(APIGateway.name, () => {
65
let client: APIGateway;
7-
let region: string;
86

97
beforeAll(async () => {
10-
const e2eTestResourcesEnv = await getE2eTestResources();
11-
Object.assign(process.env, e2eTestResourcesEnv);
12-
13-
region = process?.env?.AWS_SMOKE_TEST_REGION as string;
14-
15-
client = new APIGateway({ region });
8+
client = new APIGateway({ region: "us-west-2" });
169
});
1710

1811
describe("Making a request", () => {

clients/client-cloudformation/test/cloudformation-features.e2e.spec.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,17 @@
1-
import { getE2eTestResources } from "@aws-sdk/aws-util-test/src";
21
import { CloudFormation, paginateListStacks } from "@aws-sdk/client-cloudformation";
32
import { beforeAll, describe, expect, test as it } from "vitest";
43

5-
describe("@aws-sdk/client-cloudformation", () => {
4+
describe(CloudFormation.name, () => {
65
let client: CloudFormation;
7-
let region: string;
86

97
beforeAll(async () => {
10-
const e2eTestResourcesEnv = await getE2eTestResources();
11-
Object.assign(process.env, e2eTestResourcesEnv);
12-
13-
region = process?.env?.AWS_SMOKE_TEST_REGION as string;
14-
15-
client = new CloudFormation({ region });
8+
client = new CloudFormation({ region: "us-west-2" });
169
});
1710

1811
describe("Describing stacks", () => {
1912
it("should return stacks list when describe stacks is called", async () => {
2013
const result = await client.describeStacks({});
2114

22-
expect(result).toBeDefined();
23-
expect(result.Stacks).toBeDefined();
2415
expect(Array.isArray(result.Stacks)).toBe(true);
2516
});
2617
});
@@ -55,7 +46,6 @@ describe("@aws-sdk/client-cloudformation", () => {
5546
}
5647

5748
expect(pageCount).toBeGreaterThanOrEqual(1);
58-
expect(lastPage).toBeDefined();
5949
expect(lastPage?.NextToken).toBeUndefined(); // The last page must not contain a marker
6050
});
6151
});
Lines changed: 127 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -1,159 +1,156 @@
1-
import { getE2eTestResources } from "@aws-sdk/aws-util-test/src";
21
import { CloudFront } from "@aws-sdk/client-cloudfront";
32
import { beforeAll, describe, expect, test as it } from "vitest";
43

5-
describe("@aws-sdk/client-cloudfront", () => {
6-
let client: CloudFront;
7-
let region: string;
4+
describe(
5+
CloudFront.name,
6+
() => {
7+
let client: CloudFront;
88

9-
beforeAll(async () => {
10-
const e2eTestResourcesEnv = await getE2eTestResources();
11-
Object.assign(process.env, e2eTestResourcesEnv);
12-
13-
region = process?.env?.AWS_SMOKE_TEST_REGION as string;
14-
15-
client = new CloudFront({ region });
16-
}, 60_000);
9+
beforeAll(async () => {
10+
client = new CloudFront({ region: "us-west-2" });
11+
});
1712

18-
describe("List distributions", () => {
19-
it("should return distribution list with quantity property", async () => {
20-
const result = await client.listDistributions({});
13+
describe("List distributions", () => {
14+
it("should return distribution list with quantity property", async () => {
15+
const result = await client.listDistributions({});
2116

22-
expect(typeof result.DistributionList?.Quantity).toBe("number");
17+
expect(typeof result.DistributionList?.Quantity).toBe("number");
18+
});
2319
});
24-
});
2520

26-
describe("Create a distribution", () => {
27-
it("should handle NoSuchOrigin error for invalid origin", async () => {
28-
const uniqueRef = `aws-js-sdk-${Date.now()}-${process.pid}-${Math.random().toString(36).substr(2, 9)}`;
29-
const distributionConfig = {
30-
CallerReference: uniqueRef,
31-
Aliases: {
32-
Quantity: 0,
33-
},
34-
DefaultRootObject: "",
35-
Origins: {
36-
Items: [
37-
{
38-
Id: "InvalidOrigin",
39-
DomainName: "example.com",
40-
CustomOriginConfig: {
41-
HTTPPort: 80,
42-
HTTPSPort: 443,
43-
OriginProtocolPolicy: "match-viewer" as const,
21+
describe("Create a distribution", () => {
22+
it("should handle NoSuchOrigin error for invalid origin", async () => {
23+
const uniqueRef = `aws-js-sdk-${Date.now()}-${process.pid}-${Math.random().toString(36).substr(2, 9)}`;
24+
const distributionConfig = {
25+
CallerReference: uniqueRef,
26+
Aliases: {
27+
Quantity: 0,
28+
},
29+
DefaultRootObject: "",
30+
Origins: {
31+
Items: [
32+
{
33+
Id: "InvalidOrigin",
34+
DomainName: "example.com",
35+
CustomOriginConfig: {
36+
HTTPPort: 80,
37+
HTTPSPort: 443,
38+
OriginProtocolPolicy: "match-viewer" as const,
39+
},
40+
},
41+
],
42+
Quantity: 1,
43+
},
44+
DefaultCacheBehavior: {
45+
TargetOriginId: "NonExistentOrigin",
46+
ForwardedValues: {
47+
QueryString: false,
48+
Cookies: {
49+
Forward: "all" as const,
4450
},
4551
},
46-
],
47-
Quantity: 1,
48-
},
49-
DefaultCacheBehavior: {
50-
TargetOriginId: "NonExistentOrigin",
51-
ForwardedValues: {
52-
QueryString: false,
53-
Cookies: {
54-
Forward: "all" as const,
52+
TrustedSigners: {
53+
Items: [],
54+
Enabled: false,
55+
Quantity: 0,
5556
},
57+
ViewerProtocolPolicy: "allow-all" as const,
58+
MinTTL: 0,
5659
},
57-
TrustedSigners: {
60+
CacheBehaviors: {
5861
Items: [],
59-
Enabled: false,
6062
Quantity: 0,
6163
},
62-
ViewerProtocolPolicy: "allow-all" as const,
63-
MinTTL: 0,
64-
},
65-
CacheBehaviors: {
66-
Items: [],
67-
Quantity: 0,
68-
},
69-
Comment: "",
70-
Logging: {
64+
Comment: "",
65+
Logging: {
66+
Enabled: false,
67+
Bucket: "invalidbucket.s3.amazonaws.com",
68+
Prefix: "prefix",
69+
IncludeCookies: false,
70+
},
71+
PriceClass: "PriceClass_All" as const,
7172
Enabled: false,
72-
Bucket: "invalidbucket.s3.amazonaws.com",
73-
Prefix: "prefix",
74-
IncludeCookies: false,
75-
},
76-
PriceClass: "PriceClass_All" as const,
77-
Enabled: false,
78-
};
73+
};
7974

80-
await expect(
81-
client.createDistribution({
82-
DistributionConfig: distributionConfig,
83-
})
84-
).rejects.toThrow(
85-
expect.objectContaining({
86-
name: "NoSuchOrigin",
87-
$metadata: expect.objectContaining({
88-
httpStatusCode: 404,
89-
}),
90-
})
91-
);
75+
await expect(
76+
client.createDistribution({
77+
DistributionConfig: distributionConfig,
78+
})
79+
).rejects.toThrow(
80+
expect.objectContaining({
81+
name: "NoSuchOrigin",
82+
$metadata: expect.objectContaining({
83+
httpStatusCode: 404,
84+
}),
85+
})
86+
);
87+
});
9288
});
93-
});
9489

95-
describe("Error handling", () => {
96-
it("should handle InvalidArgument for empty name prefix", async () => {
97-
const distributionConfig = {
98-
CallerReference: "",
99-
Aliases: {
100-
Quantity: 0,
101-
},
102-
DefaultRootObject: "",
103-
Origins: {
104-
Items: [
105-
{
106-
Id: "origin",
107-
DomainName: "example.com",
108-
CustomOriginConfig: {
109-
HTTPPort: 80,
110-
HTTPSPort: 443,
111-
OriginProtocolPolicy: "match-viewer" as const,
90+
describe("Error handling", () => {
91+
it("should handle InvalidArgument for empty name prefix", async () => {
92+
const distributionConfig = {
93+
CallerReference: "",
94+
Aliases: {
95+
Quantity: 0,
96+
},
97+
DefaultRootObject: "",
98+
Origins: {
99+
Items: [
100+
{
101+
Id: "origin",
102+
DomainName: "example.com",
103+
CustomOriginConfig: {
104+
HTTPPort: 80,
105+
HTTPSPort: 443,
106+
OriginProtocolPolicy: "match-viewer" as const,
107+
},
108+
},
109+
],
110+
Quantity: 1,
111+
},
112+
DefaultCacheBehavior: {
113+
TargetOriginId: "origin",
114+
ForwardedValues: {
115+
QueryString: false,
116+
Cookies: {
117+
Forward: "all" as const,
112118
},
113119
},
114-
],
115-
Quantity: 1,
116-
},
117-
DefaultCacheBehavior: {
118-
TargetOriginId: "origin",
119-
ForwardedValues: {
120-
QueryString: false,
121-
Cookies: {
122-
Forward: "all" as const,
120+
TrustedSigners: {
121+
Items: [],
122+
Enabled: false,
123+
Quantity: 0,
123124
},
125+
ViewerProtocolPolicy: "allow-all" as const,
126+
MinTTL: 0,
124127
},
125-
TrustedSigners: {
128+
CacheBehaviors: {
126129
Items: [],
127-
Enabled: false,
128130
Quantity: 0,
129131
},
130-
ViewerProtocolPolicy: "allow-all" as const,
131-
MinTTL: 0,
132-
},
133-
CacheBehaviors: {
134-
Items: [],
135-
Quantity: 0,
136-
},
137-
Comment: "",
138-
Logging: {
132+
Comment: "",
133+
Logging: {
134+
Enabled: false,
135+
Bucket: "invalidbucket.s3.amazonaws.com",
136+
Prefix: "prefix",
137+
IncludeCookies: false,
138+
},
139+
PriceClass: "PriceClass_All" as const,
139140
Enabled: false,
140-
Bucket: "invalidbucket.s3.amazonaws.com",
141-
Prefix: "prefix",
142-
IncludeCookies: false,
143-
},
144-
PriceClass: "PriceClass_All" as const,
145-
Enabled: false,
146-
};
141+
};
147142

148-
await expect(
149-
client.createDistribution({
150-
DistributionConfig: distributionConfig,
151-
})
152-
).rejects.toThrow(
153-
expect.objectContaining({
154-
name: "InvalidArgument",
155-
})
156-
);
143+
await expect(
144+
client.createDistribution({
145+
DistributionConfig: distributionConfig,
146+
})
147+
).rejects.toThrow(
148+
expect.objectContaining({
149+
name: "InvalidArgument",
150+
})
151+
);
152+
});
157153
});
158-
});
159-
}, 60_000);
154+
},
155+
60_000
156+
);

clients/client-cloudtrail/test/cloudtrail-features.e2e.spec.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
import { getE2eTestResources } from "@aws-sdk/aws-util-test/src";
21
import { CloudTrail } from "@aws-sdk/client-cloudtrail";
32
import { beforeAll, describe, expect, test as it } from "vitest";
43

5-
describe("@aws-sdk/client-cloudtrail", () => {
4+
describe(CloudTrail.name, () => {
65
let client: CloudTrail;
7-
let region: string;
86

97
beforeAll(async () => {
10-
const e2eTestResourcesEnv = await getE2eTestResources();
11-
Object.assign(process.env, e2eTestResourcesEnv);
12-
13-
region = process?.env?.AWS_SMOKE_TEST_REGION as string;
14-
15-
client = new CloudTrail({ region });
8+
client = new CloudTrail({ region: "us-west-2" });
169
});
1710

1811
describe("Describe trails", () => {

0 commit comments

Comments
 (0)