Skip to content

Commit 0ef831e

Browse files
committed
test(client-cloudwatch): use region from integTestResourceEnv
1 parent 833dc9e commit 0ef831e

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

clients/client-cloudwatch/test/e2e/query-compatibility.e2e.spec.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
import { CloudWatchClient, GetDashboardCommand } from "@aws-sdk/client-cloudwatch";
2-
import { afterAll, beforeAll, describe, expect, test as it } from "vitest";
2+
import { beforeAll, describe, expect, test as it } from "vitest";
3+
4+
import { getIntegTestResources } from "../../../../tests/e2e/get-integ-test-resources";
35

46
describe("CloudWatch Query Compatibility E2E", () => {
57
let client: CloudWatchClient;
8+
let region: string;
69

7-
beforeAll(() => {
8-
client = new CloudWatchClient({
9-
region: "us-west-2",
10-
});
11-
});
10+
beforeAll(async () => {
11+
const integTestResourcesEnv = await getIntegTestResources();
12+
Object.assign(process.env, integTestResourcesEnv);
13+
14+
region = process?.env?.AWS_SMOKE_TEST_REGION as string;
1215

13-
afterAll(() => {
14-
client.destroy();
16+
client = new CloudWatchClient({ region });
1517
});
1618

1719
it("AmbiguousErrorResolution", async () => {

0 commit comments

Comments
 (0)