diff --git a/packages/credential-provider-ini/src/fromIni.integ.spec.ts b/packages/credential-provider-ini/src/fromIni.integ.spec.ts index db15da42fa6c..e4a5542d69f7 100644 --- a/packages/credential-provider-ini/src/fromIni.integ.spec.ts +++ b/packages/credential-provider-ini/src/fromIni.integ.spec.ts @@ -3,7 +3,7 @@ import { HttpRequest, HttpResponse } from "@smithy/protocol-http"; import { SourceProfileInit } from "@smithy/shared-ini-file-loader"; import type { NodeHttpHandlerOptions, ParsedIniData } from "@smithy/types"; import { PassThrough } from "node:stream"; -import { beforeEach, describe, expect, test as it, vi } from "vitest"; +import { afterEach, beforeEach, describe, expect, test as it, vi } from "vitest"; import { fromIni } from "./fromIni"; @@ -133,6 +133,7 @@ class MockNodeHttpHandler { describe("fromIni region search order", () => { beforeEach(() => { + process.env.AWS_PROFILE = "default"; iniProfileData = { default: { region: "us-west-2", @@ -153,6 +154,10 @@ describe("fromIni region search order", () => { }); }); + afterEach(() => { + delete process.env.AWS_PROFILE; + }); + it("should use 1st priority for the clientConfig given to the provider factory", async () => { const sts = new STS({ requestHandler: new MockNodeHttpHandler(),