Skip to content

Commit

Permalink
chore: fix linting failures
Browse files Browse the repository at this point in the history
  • Loading branch information
SolP-Aleios committed Oct 19, 2023
1 parent b431d08 commit 037c479
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const getDynamoDBCommand = (eventId: string): GetItemCommand =>
});

const queryDynamodbReturnsItem = async (
eventId: string,
eventId: string

Check failure on line 28 in src/example-architecture/__tests__/importEvent.integration.test.ts

View workflow job for this annotation

GitHub Actions / Deploy and Run Tests

Insert `,`
): Promise<GetItemCommandOutput | object> => {
try {
const itemResponse = await client.send(getDynamoDBCommand(eventId));
Expand All @@ -39,7 +39,7 @@ const queryDynamodbReturnsItem = async (
};

const getEventId = (
events: PutEventsResultEntry[] | undefined,
events: PutEventsResultEntry[] | undefined

Check failure on line 42 in src/example-architecture/__tests__/importEvent.integration.test.ts

View workflow job for this annotation

GitHub Actions / Deploy and Run Tests

Insert `,`
): string | undefined => {
if (
events === undefined ||
Expand All @@ -58,7 +58,7 @@ const wait = (interval: number) =>
});

const pollDynamoDB = async (
events: PutEventsResultEntry[] | undefined,
events: PutEventsResultEntry[] | undefined

Check failure on line 61 in src/example-architecture/__tests__/importEvent.integration.test.ts

View workflow job for this annotation

GitHub Actions / Deploy and Run Tests

Insert `,`
): Promise<object> => {
const eventId = getEventId(events);
if (eventId === undefined) return {};
Expand All @@ -79,7 +79,7 @@ describe("Given a producer lambda that returns a Contract", () => {
describe("When that lambda is invoked and returns an event response", async () => {
const invokedLambda = await lambda.invoke(params);
const body: PutEventsResponse = JSON.parse(
Buffer.from(invokedLambda.Payload ?? "").toString(),
Buffer.from(invokedLambda.Payload ?? "").toString()

Check failure on line 82 in src/example-architecture/__tests__/importEvent.integration.test.ts

View workflow job for this annotation

GitHub Actions / Deploy and Run Tests

Insert `,`
);

it("Response with an eventId is returned without an error", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export class Consumer extends Construct {

lambdaRole.addManagedPolicy(
ManagedPolicy.fromAwsManagedPolicyName(
"service-role/AWSLambdaBasicExecutionRole",
),
"service-role/AWSLambdaBasicExecutionRole"

Check failure on line 29 in src/example-architecture/consumer/functions/consumer/config.ts

View workflow job for this annotation

GitHub Actions / Deploy and Run Tests

Insert `,`
)
);

const dynamoDBTable = new Table(scope, "consumerTestTable", {
Expand All @@ -39,7 +39,7 @@ export class Consumer extends Construct {
new PolicyStatement({
actions: ["dynamodb:PutItem"],
resources: [dynamoDBTable.tableArn],
}),
})
);

this.consumerLambda = new NodejsFunction(this, "ConsumerLambda", {
Expand All @@ -57,7 +57,7 @@ export class Consumer extends Construct {
const eventBus = EventBus.fromEventBusArn(
this,
"ExampleArchitectureEventBus",
eventBusArn,
eventBusArn
);

const rule = new Rule(this, "rule", {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ describe("getCdkHandlerPath", () => {

it("should customize the extension when given an extension parameter", () => {
expect(getCdkHandlerPath("/path/to/file", { extension: "mjs" })).toBe(
"/path/to/file/handler.mjs",
"/path/to/file/handler.mjs"
);
});

it("should customize the filename when given a filename parameter", () => {
expect(
getCdkHandlerPath("/path/to/file", {
fileName: "toto",
}),
})
).toBe("/path/to/file/toto.ts");
});
});
2 changes: 1 addition & 1 deletion src/example-architecture/helpers/getCdkHandlerPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type GetCdkHandlerPathProps = {

export const getCdkHandlerPath = (
directoryPath: string,
props?: GetCdkHandlerPathProps,
props?: GetCdkHandlerPathProps
): string => {
const processRunLocation = process.cwd();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ export class Producer extends Construct {

lambdaRole.addManagedPolicy(
ManagedPolicy.fromAwsManagedPolicyName(
"service-role/AWSLambdaBasicExecutionRole",
),
"service-role/AWSLambdaBasicExecutionRole"
)
);

lambdaRole.addToPolicy(
new PolicyStatement({
actions: ["events:PutEvents"],
resources: [eventBusArn],
}),
})
);

this.producerLambda = new NodejsFunction(this, "ProducerLambda", {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type PutEventsResponse } from "@aws-sdk/client-eventbridge";
import { Event } from "classes/Event";
import { PersonRegisteredContract } from "example-architecture/events/contracts/personRegisteredContractV1";
import { getEnvVariable } from "example-architecture/helpers/getEnvVariable";
import { Event } from "classes/Event";

export const handler = async (): Promise<PutEventsResponse> => {
const contract: PersonRegisteredContract = {
Expand Down

0 comments on commit 037c479

Please sign in to comment.