Skip to content

Commit

Permalink
test: fixed aws core service tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ericvilla committed Mar 7, 2024
1 parent d711060 commit d367f46
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/core/src/services/aws-core-service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ describe("AwsCoreService", () => {
writeFileSync: jest.fn((_file, _data) => {}),
},
} as any;
const httpHandler = {} as any;

test("getRegions", () => {
const awsCoreService = new AwsCoreService(null, null);
const awsCoreService = new AwsCoreService(httpHandler, null, null);

expect(awsCoreService.getRegions()).toEqual([
{
Expand Down Expand Up @@ -114,22 +115,22 @@ describe("AwsCoreService", () => {
});

test("awsCredentialPath", () => {
const awsCoreService = new AwsCoreService(nativeService, null);
const awsCoreService = new AwsCoreService(httpHandler, nativeService, null);
expect(awsCoreService.awsCredentialPath()).toBe(nativeService.path.join(`${homedir}`, `.aws`, `credentials`));
});

test("awsBkpCredentialPath", () => {
const awsCoreService = new AwsCoreService(nativeService, null);
const awsCoreService = new AwsCoreService(httpHandler, nativeService, null);
expect(awsCoreService.awsBkpCredentialPath()).toBe(nativeService.path.join(`${homedir}`, `.aws`, `credentials.bkp`));
});

test("awsConfigPath", () => {
const awsCoreService = new AwsCoreService(nativeService, null);
const awsCoreService = new AwsCoreService(httpHandler, nativeService, null);
expect(awsCoreService.awsConfigPath()).toBe(nativeService.path.join(`${homedir}`, `.aws`, `config`));
});

test("awsBkpConfigPath", () => {
const awsCoreService = new AwsCoreService(nativeService, null);
const awsCoreService = new AwsCoreService(httpHandler, nativeService, null);
expect(awsCoreService.awsBkpConfigPath()).toBe(nativeService.path.join(`${homedir}`, `.aws`, `config.bkp`));
});

Expand All @@ -142,7 +143,7 @@ describe("AwsCoreService", () => {
const session2 = {
region: undefined,
} as any;
const awsCoreService = new AwsCoreService(nativeService, null);
const awsCoreService = new AwsCoreService(httpHandler, nativeService, null);
const result = awsCoreService.stsOptions(session);
expect(result).toStrictEqual({
maxRetries: 0,
Expand Down

0 comments on commit d367f46

Please sign in to comment.