Skip to content

Commit

Permalink
test(credential-provider-ini): set profile in integ test (#6732)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe authored Dec 13, 2024
1 parent a65995f commit 0131280
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/credential-provider-ini/src/fromIni.integ.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -133,6 +133,7 @@ class MockNodeHttpHandler {

describe("fromIni region search order", () => {
beforeEach(() => {
process.env.AWS_PROFILE = "default";
iniProfileData = {
default: {
region: "us-west-2",
Expand All @@ -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(),
Expand Down

0 comments on commit 0131280

Please sign in to comment.