Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion clients/client-acm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"generate:client": "node ../../scripts/generate-clients/single-service --solo acm"
"generate:client": "node ../../scripts/generate-clients/single-service --solo acm",
"test:e2e": "yarn g:vitest run -c vitest.config.e2e.mts"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include a test:e2e:watch script counterpart for all test scripts

},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
41 changes: 41 additions & 0 deletions clients/client-acm/test/acm-features.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { getE2eTestResources } from "@aws-sdk/aws-util-test/src";
import { ACM } from "@aws-sdk/client-acm";
import { beforeAll, describe, expect, test as it } from "vitest";

describe("@aws-sdk/client-acm", () => {
let client: ACM;
let region: string;

beforeAll(async () => {
const e2eTestResourcesEnv = await getE2eTestResources();
Object.assign(process.env, e2eTestResourcesEnv);

region = process?.env?.AWS_SMOKE_TEST_REGION as string;

client = new ACM({ region });
});

describe("Making a request to ACM service", () => {
it("should successfully list certificates", async () => {
const result = await client.listCertificates({});

expect(result).toBeDefined();
expect(result.CertificateSummaryList).toBeDefined();
expect(Array.isArray(result.CertificateSummaryList)).toBe(true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for a triple chain of assertions, since the third one covers all 3

});
});

describe("Error handling", () => {
it("should handle ValidationException for invalid certificate ARN", async () => {
await expect(
client.describeCertificate({
CertificateArn: "fake_arn",
})
).rejects.toThrow(
expect.objectContaining({
name: "ValidationException",
})
);
});
});
});
10 changes: 10 additions & 0 deletions clients/client-acm/vitest.config.e2e.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
exclude: ["**/*.browser.e2e.spec.ts"],
include: ["**/*.e2e.spec.ts"],
environment: "node",
},
mode: "development",
});
3 changes: 2 additions & 1 deletion clients/client-api-gateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"generate:client": "node ../../scripts/generate-clients/single-service --solo api-gateway"
"generate:client": "node ../../scripts/generate-clients/single-service --solo api-gateway",
"test:e2e": "yarn g:vitest run -c vitest.config.e2e.mts"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
41 changes: 41 additions & 0 deletions clients/client-api-gateway/test/apigateway-features.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { getE2eTestResources } from "@aws-sdk/aws-util-test/src";
import { APIGateway } from "@aws-sdk/client-api-gateway";
import { beforeAll, describe, expect, test as it } from "vitest";

describe("@aws-sdk/client-api-gateway", () => {
let client: APIGateway;
let region: string;

beforeAll(async () => {
const e2eTestResourcesEnv = await getE2eTestResources();
Object.assign(process.env, e2eTestResourcesEnv);

region = process?.env?.AWS_SMOKE_TEST_REGION as string;

client = new APIGateway({ region });
});

describe("Making a request", () => {
it("should successfully get REST APIs", async () => {
const result = await client.getRestApis({});

expect(result).toBeDefined();
expect(result.items).toBeDefined();
expect(Array.isArray(result.items)).toBe(true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only need one assertion

});
});

describe("Error handling", () => {
it("should handle NotFoundException for invalid REST API ID", async () => {
await expect(
client.getRestApi({
restApiId: "fake_id",
})
).rejects.toThrow(
expect.objectContaining({
name: "NotFoundException",
})
);
});
});
});
10 changes: 10 additions & 0 deletions clients/client-api-gateway/vitest.config.e2e.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
exclude: ["**/*.browser.e2e.spec.ts"],
include: ["**/*.e2e.spec.ts"],
environment: "node",
},
mode: "development",
});
3 changes: 2 additions & 1 deletion clients/client-cloudformation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"extract:docs": "api-extractor run --local",
"generate:client": "node ../../scripts/generate-clients/single-service --solo cloudformation"
"generate:client": "node ../../scripts/generate-clients/single-service --solo cloudformation",
"test:e2e": "yarn g:vitest run -c vitest.config.e2e.mts"
},
"main": "./dist-cjs/index.js",
"types": "./dist-types/index.d.ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { getE2eTestResources } from "@aws-sdk/aws-util-test/src";
import { CloudFormation, paginateListStacks } from "@aws-sdk/client-cloudformation";
import { beforeAll, describe, expect, test as it } from "vitest";

describe("@aws-sdk/client-cloudformation", () => {
let client: CloudFormation;
let region: string;

beforeAll(async () => {
const e2eTestResourcesEnv = await getE2eTestResources();
Object.assign(process.env, e2eTestResourcesEnv);

region = process?.env?.AWS_SMOKE_TEST_REGION as string;

client = new CloudFormation({ region });
});

describe("Describing stacks", () => {
it("should return stacks list when describing stacks is called", async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DescribeStacks is the operation name, not describing stacks

const result = await client.describeStacks({});

expect(result).toBeDefined();
expect(result.Stacks).toBeDefined();
expect(Array.isArray(result.Stacks)).toBe(true);
});
});

describe("Error handling", () => {
it("should handle ValidationError for invalid stack creation", async () => {
const templateBody = '{"Resources":{"member":{"Type":"AWS::SQS::Queue"}}}';

await expect(
client.createStack({
TemplateBody: templateBody,
StackName: "", // Empty name should cause ValidationError
})
).rejects.toThrow(
expect.objectContaining({
name: "ValidationError",
})
);
});
});

describe("Paginating responses", () => {
it("should paginate listStacks operation", async () => {
const paginator = paginateListStacks({ client }, {});

let pageCount = 0;
let lastPage;

for await (const page of paginator) {
pageCount++;
lastPage = page;
if (pageCount >= 3) break; // Get at least three pages
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test doesn't match the original test

"the last page must not contain a marker" i'm guessing this refers to the pagination token

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you are right.

}

expect(pageCount).toBeGreaterThanOrEqual(1);
expect(lastPage).toBeDefined();
});
});
});
10 changes: 10 additions & 0 deletions clients/client-cloudformation/vitest.config.e2e.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
exclude: ["**/*.browser.e2e.spec.ts"],
include: ["**/*.e2e.spec.ts"],
environment: "node",
},
mode: "development",
});
17 changes: 0 additions & 17 deletions features/acm/acm.feature

This file was deleted.

7 changes: 0 additions & 7 deletions features/acm/step_definitions/acm.js

This file was deleted.

17 changes: 0 additions & 17 deletions features/apigateway/apigateway.feature

This file was deleted.

7 changes: 0 additions & 7 deletions features/apigateway/step_definitions/apigateway.js

This file was deleted.

20 changes: 0 additions & 20 deletions features/cloudformation/cloudformation.feature

This file was deleted.

18 changes: 0 additions & 18 deletions features/cloudformation/step_definitions/cloudformation.js

This file was deleted.

Loading