Skip to content

Commit f0f8bf1

Browse files
committed
lint other lambdas
1 parent 830d2aa commit f0f8bf1

File tree

10 files changed

+62
-56
lines changed

10 files changed

+62
-56
lines changed

lambdas/letter-updates-transformer/jest.config.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import type { Config } from 'jest';
1+
import type { Config } from "jest";
22

33
export const baseJestConfig: Config = {
4-
preset: 'ts-jest',
4+
preset: "ts-jest",
55

66
// Automatically clear mock calls, instances, contexts and results before every test
77
clearMocks: true,
@@ -10,10 +10,10 @@ export const baseJestConfig: Config = {
1010
collectCoverage: true,
1111

1212
// The directory where Jest should output its coverage files
13-
coverageDirectory: './.reports/unit/coverage',
13+
coverageDirectory: "./.reports/unit/coverage",
1414

1515
// Indicates which provider should be used to instrument code for coverage
16-
coverageProvider: 'babel',
16+
coverageProvider: "babel",
1717

1818
coverageThreshold: {
1919
global: {
@@ -24,36 +24,36 @@ export const baseJestConfig: Config = {
2424
},
2525
},
2626

27-
coveragePathIgnorePatterns: ['/__tests__/'],
28-
transform: { '^.+\\.ts$': 'ts-jest' },
29-
testPathIgnorePatterns: ['.build'],
30-
testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'],
27+
coveragePathIgnorePatterns: ["/__tests__/"],
28+
transform: { "^.+\\.ts$": "ts-jest" },
29+
testPathIgnorePatterns: [".build"],
30+
testMatch: ["**/?(*.)+(spec|test).[jt]s?(x)"],
3131

3232
// Use this configuration option to add custom reporters to Jest
3333
reporters: [
34-
'default',
34+
"default",
3535
[
36-
'jest-html-reporter',
36+
"jest-html-reporter",
3737
{
38-
pageTitle: 'Test Report',
39-
outputPath: './.reports/unit/test-report.html',
38+
pageTitle: "Test Report",
39+
outputPath: "./.reports/unit/test-report.html",
4040
includeFailureMsg: true,
4141
},
4242
],
4343
],
4444

4545
// The test environment that will be used for testing
46-
testEnvironment: 'jsdom',
46+
testEnvironment: "jsdom",
4747
};
4848

4949
const utilsJestConfig = {
5050
...baseJestConfig,
5151

52-
testEnvironment: 'node',
52+
testEnvironment: "node",
5353

5454
coveragePathIgnorePatterns: [
5555
...(baseJestConfig.coveragePathIgnorePatterns ?? []),
56-
'zod-validators.ts',
56+
"zod-validators.ts",
5757
],
5858
};
5959

lambdas/letter-updates-transformer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"dependencies": {
3+
"@types/aws-lambda": "^8.10.148",
34
"esbuild": "^0.24.0"
45
},
56
"devDependencies": {
67
"@tsconfig/node22": "^22.0.2",
7-
"@types/aws-lambda": "^8.10.148",
88
"@types/jest": "^30.0.0",
99
"jest": "^30.2.0",
1010
"jest-mock-extended": "^4.0.0",
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { handler } from '../index';
2-
import type { Context } from 'aws-lambda';
3-
import { mockDeep } from 'jest-mock-extended';
1+
import type { Context } from "aws-lambda";
2+
import { mockDeep } from "jest-mock-extended";
3+
import handler from "..";
44

5-
describe('event-logging Lambda', () => {
6-
it('logs the input event and returns 200', async () => {
7-
const event = { foo: 'bar' };
5+
describe("event-logging Lambda", () => {
6+
it("logs the input event and returns 200", async () => {
7+
const event = { foo: "bar" };
88
const context = mockDeep<Context>();
99
const callback = jest.fn();
1010
const result = await handler(event, context, callback);
1111

1212
expect(result).toEqual({
1313
statusCode: 200,
14-
body: 'Event logged',
14+
body: "Event logged",
1515
});
1616
});
1717
});
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
// Replace me with the actual code for your Lambda function
2-
import { Handler } from 'aws-lambda';
2+
import { Handler } from "aws-lambda";
33

4-
export const handler: Handler = async (event) => {
5-
console.log('Received event:', event);
4+
const handler: Handler = async (event) => {
5+
console.log("Received event:", event);
66
return {
77
statusCode: 200,
8-
body: 'Event logged',
8+
body: "Event logged",
99
};
1010
};
11+
12+
export default handler;

lambdas/letter-updates-transformer/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
2-
"extends": "@tsconfig/node22/tsconfig.json",
2+
"compilerOptions": {},
3+
"extends": "../../tsconfig.base.json",
34
"include": [
45
"src/**/*",
56
"jest.config.ts"

lambdas/upsert-letter/jest.config.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import type { Config } from 'jest';
1+
import type { Config } from "jest";
22

33
export const baseJestConfig: Config = {
4-
preset: 'ts-jest',
4+
preset: "ts-jest",
55

66
// Automatically clear mock calls, instances, contexts and results before every test
77
clearMocks: true,
@@ -10,10 +10,10 @@ export const baseJestConfig: Config = {
1010
collectCoverage: true,
1111

1212
// The directory where Jest should output its coverage files
13-
coverageDirectory: './.reports/unit/coverage',
13+
coverageDirectory: "./.reports/unit/coverage",
1414

1515
// Indicates which provider should be used to instrument code for coverage
16-
coverageProvider: 'babel',
16+
coverageProvider: "babel",
1717

1818
coverageThreshold: {
1919
global: {
@@ -24,36 +24,36 @@ export const baseJestConfig: Config = {
2424
},
2525
},
2626

27-
coveragePathIgnorePatterns: ['/__tests__/'],
28-
transform: { '^.+\\.ts$': 'ts-jest' },
29-
testPathIgnorePatterns: ['.build'],
30-
testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'],
27+
coveragePathIgnorePatterns: ["/__tests__/"],
28+
transform: { "^.+\\.ts$": "ts-jest" },
29+
testPathIgnorePatterns: [".build"],
30+
testMatch: ["**/?(*.)+(spec|test).[jt]s?(x)"],
3131

3232
// Use this configuration option to add custom reporters to Jest
3333
reporters: [
34-
'default',
34+
"default",
3535
[
36-
'jest-html-reporter',
36+
"jest-html-reporter",
3737
{
38-
pageTitle: 'Test Report',
39-
outputPath: './.reports/unit/test-report.html',
38+
pageTitle: "Test Report",
39+
outputPath: "./.reports/unit/test-report.html",
4040
includeFailureMsg: true,
4141
},
4242
],
4343
],
4444

4545
// The test environment that will be used for testing
46-
testEnvironment: 'jsdom',
46+
testEnvironment: "jsdom",
4747
};
4848

4949
const utilsJestConfig = {
5050
...baseJestConfig,
5151

52-
testEnvironment: 'node',
52+
testEnvironment: "node",
5353

5454
coveragePathIgnorePatterns: [
5555
...(baseJestConfig.coveragePathIgnorePatterns ?? []),
56-
'zod-validators.ts',
56+
"zod-validators.ts",
5757
],
5858
};
5959

lambdas/upsert-letter/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"dependencies": {
3+
"@types/aws-lambda": "^8.10.148",
34
"esbuild": "^0.24.0"
45
},
56
"devDependencies": {
67
"@tsconfig/node22": "^22.0.2",
7-
"@types/aws-lambda": "^8.10.148",
88
"@types/jest": "^30.0.0",
99
"jest": "^30.2.0",
1010
"jest-mock-extended": "^4.0.0",
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { handler } from '../index';
2-
import type { Context } from 'aws-lambda';
3-
import { mockDeep } from 'jest-mock-extended';
1+
import type { Context } from "aws-lambda";
2+
import { mockDeep } from "jest-mock-extended";
3+
import handler from "..";
44

5-
describe('event-logging Lambda', () => {
6-
it('logs the input event and returns 200', async () => {
7-
const event = { foo: 'bar' };
5+
describe("event-logging Lambda", () => {
6+
it("logs the input event and returns 200", async () => {
7+
const event = { foo: "bar" };
88
const context = mockDeep<Context>();
99
const callback = jest.fn();
1010
const result = await handler(event, context, callback);
1111

1212
expect(result).toEqual({
1313
statusCode: 200,
14-
body: 'Event logged',
14+
body: "Event logged",
1515
});
1616
});
1717
});

lambdas/upsert-letter/src/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
// Replace me with the actual code for your Lambda function
2-
import { Handler } from 'aws-lambda';
2+
import { Handler } from "aws-lambda";
33

4-
export const handler: Handler = async (event) => {
5-
console.log('Received event:', event);
4+
const handler: Handler = async (event) => {
5+
console.log("Received event:", event);
66
return {
77
statusCode: 200,
8-
body: 'Event logged',
8+
body: "Event logged",
99
};
1010
};
11+
12+
export default handler;

lambdas/upsert-letter/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
2-
"extends": "@tsconfig/node22/tsconfig.json",
2+
"compilerOptions": {},
3+
"extends": "../../tsconfig.base.json",
34
"include": [
45
"src/**/*",
56
"jest.config.ts"

0 commit comments

Comments
 (0)