Skip to content

Commit

Permalink
Fix ACMWrapper options position
Browse files Browse the repository at this point in the history
  • Loading branch information
rddimon committed May 4, 2023
1 parent 2361e4f commit a96ed0a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/aws/acm-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const certStatuses = ["PENDING_VALIDATION", "ISSUED", "INACTIVE"];
class ACMWrapper {
public acm: ACMClient;

constructor(endpointType: string, credentials?: any) {
constructor(credentials: any, endpointType: string) {
const isEdge = endpointType === Globals.endpointTypes.edge;
this.acm = new ACMClient({
credentials,
Expand Down
16 changes: 8 additions & 8 deletions test/unit-tests/aws/acm-wrapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ const certTestData = {

describe("ACM Wrapper checks", () => {
it("Initialization edge", async () => {
const acmWrapper = new ACMWrapper(Globals.endpointTypes.edge);
const acmWrapper = new ACMWrapper(null, Globals.endpointTypes.edge);
const actualResult = await acmWrapper.acm.config.region();
expect(actualResult).to.equal(Globals.defaultRegion);
});

it("Initialization regional", async () => {
const acmWrapper = new ACMWrapper(Globals.endpointTypes.regional);
const acmWrapper = new ACMWrapper(null, Globals.endpointTypes.regional);
const actualResult = await acmWrapper.acm.config.region();
expect(actualResult).to.equal(Globals.nodeRegion);
});
Expand All @@ -39,7 +39,7 @@ describe("ACM Wrapper checks", () => {
const ACMCMock = mockClient(ACMClient);
ACMCMock.on(ListCertificatesCommand).resolves(certTestData);

const acmWrapper = new ACMWrapper(Globals.endpointTypes.regional);
const acmWrapper = new ACMWrapper(null, Globals.endpointTypes.regional);
const dc = new DomainConfig(getDomainConfig({
certificateName: "cert_name"
}));
Expand All @@ -52,7 +52,7 @@ describe("ACM Wrapper checks", () => {
const ACMCMock = mockClient(ACMClient);
ACMCMock.on(ListCertificatesCommand).resolves(certTestData);

const acmWrapper = new ACMWrapper(Globals.endpointTypes.regional);
const acmWrapper = new ACMWrapper(null, Globals.endpointTypes.regional);
const dc = new DomainConfig(getDomainConfig({
domainName: "test_domain",
}));
Expand All @@ -66,7 +66,7 @@ describe("ACM Wrapper checks", () => {
ACMCMock.on(ListCertificatesCommand).resolves(certTestData);

const certificateName = "not_existing_certificate"
const acmWrapper = new ACMWrapper(Globals.endpointTypes.regional);
const acmWrapper = new ACMWrapper(null, Globals.endpointTypes.regional);
const dc = new DomainConfig(getDomainConfig({certificateName}));

let errored = false;
Expand All @@ -92,7 +92,7 @@ describe("ACM Wrapper checks", () => {
}]
});

const acmWrapper = new ACMWrapper(Globals.endpointTypes.regional);
const acmWrapper = new ACMWrapper(null, Globals.endpointTypes.regional);
const dc = new DomainConfig(getDomainConfig({
domainName: "sub.test_domain",
}));
Expand All @@ -106,7 +106,7 @@ describe("ACM Wrapper checks", () => {
ACMCMock.on(ListCertificatesCommand).resolves(certTestData);

const domainName = "not_existing_domain"
const acmWrapper = new ACMWrapper(Globals.endpointTypes.regional);
const acmWrapper = new ACMWrapper(null, Globals.endpointTypes.regional);
const dc = new DomainConfig(getDomainConfig({domainName}));

let errored = false;
Expand All @@ -123,7 +123,7 @@ describe("ACM Wrapper checks", () => {
const ACMCMock = mockClient(ACMClient);
ACMCMock.on(ListCertificatesCommand).rejects();

const acmWrapper = new ACMWrapper(Globals.endpointTypes.regional);
const acmWrapper = new ACMWrapper(null, Globals.endpointTypes.regional);
const dc = new DomainConfig(getDomainConfig({
domainName: "test_domain",
}));
Expand Down

0 comments on commit a96ed0a

Please sign in to comment.