Skip to content

Commit 39341be

Browse files
committed
lint pass
1 parent 31ad071 commit 39341be

4 files changed

Lines changed: 38 additions & 24 deletions

File tree

docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"debug": "JEKYLL_ENV=development BUNDLE_GEMFILE=Gemfile bundle exec jekyll serve --config _config.yml,_config.dev.yml,_config.version.yml --limit_posts 100 --trace",
1616
"generate-includes": "./generate-includes.sh",
1717
"lint": "echo \"Documentation module has no code to lint\"",
18+
"lint:fix": "echo \"Documentation module has no code to lint\"",
1819
"test:unit": "echo \"Documentation module has no unit tests\"",
1920
"typecheck": "echo \"Documentation module has no typescript to typecheck\""
2021
},

lambdas/letter-updates-transformer/src/__tests__/letter-updates-transformer.test.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,18 @@ describe("letter-updates-transformer Lambda", () => {
188188

189189
// Create a Kinesis event with malformed JSON data
190190
const malformedKinesisEvent: KinesisStreamEvent = {
191-
Records: [{
192-
kinesis: {
193-
data: Buffer.from("invalid-json-data").toString("base64"),
194-
sequenceNumber: "12345"
195-
}
196-
} as any]
191+
Records: [
192+
{
193+
kinesis: {
194+
data: Buffer.from("invalid-json-data").toString("base64"),
195+
sequenceNumber: "12345",
196+
},
197+
} as any,
198+
],
197199
};
198200

199201
await expect(
200-
handler(malformedKinesisEvent, mockDeep<Context>(), jest.fn())
202+
handler(malformedKinesisEvent, mockDeep<Context>(), jest.fn()),
201203
).rejects.toThrow();
202204

203205
expect(mockedDeps.logger.error).toHaveBeenCalledWith(
@@ -206,10 +208,10 @@ describe("letter-updates-transformer Lambda", () => {
206208
error: expect.any(Error),
207209
record: expect.objectContaining({
208210
kinesis: expect.objectContaining({
209-
data: Buffer.from("invalid-json-data").toString("base64")
210-
})
211-
})
212-
})
211+
data: Buffer.from("invalid-json-data").toString("base64"),
212+
}),
213+
}),
214+
}),
213215
);
214216
});
215217

@@ -224,8 +226,8 @@ describe("letter-updates-transformer Lambda", () => {
224226
expect(mockedDeps.logger.info).toHaveBeenCalledWith(
225227
expect.objectContaining({
226228
description: "Number of records",
227-
count: 0
228-
})
229+
count: 0,
230+
}),
229231
);
230232
expect(mockedDeps.snsClient.send).not.toHaveBeenCalled();
231233
});

lambdas/letter-updates-transformer/src/letter-updates-transformer.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ const BATCH_SIZE = 10;
2020
export default function createHandler(deps: Deps): Handler<KinesisStreamEvent> {
2121
return async (streamEvent: KinesisStreamEvent) => {
2222
deps.logger.info({ description: "Received event", streamEvent });
23-
deps.logger.info({ description: "Number of records", count: streamEvent.Records?.length || 0 });
23+
deps.logger.info({
24+
description: "Number of records",
25+
count: streamEvent.Records?.length || 0,
26+
});
2427

2528
// Ensure logging by extracting all records first
2629
const ddbRecords: DynamoDBRecord[] = streamEvent.Records.map((record) =>
@@ -78,7 +81,10 @@ function extractPayload(
7881
deps: Deps,
7982
): DynamoDBRecord {
8083
try {
81-
deps.logger.info({ description: "Processing Kinesis record", recordId: record.kinesis.sequenceNumber });
84+
deps.logger.info({
85+
description: "Processing Kinesis record",
86+
recordId: record.kinesis.sequenceNumber,
87+
});
8288

8389
// Kinesis data is base64 encoded
8490
const payload = Buffer.from(record.kinesis.data, "base64").toString("utf8");
@@ -88,7 +94,11 @@ function extractPayload(
8894
deps.logger.info({ description: "Extracted dynamoDBRecord", jsonParsed });
8995
return jsonParsed;
9096
} catch (error) {
91-
deps.logger.error({ description: "Error extracting payload", error, record });
97+
deps.logger.error({
98+
description: "Error extracting payload",
99+
error,
100+
record,
101+
});
92102
throw error;
93103
}
94104
}

pact-contracts/package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
{
2-
"name": "@nhsdigital/notify-supplier-api-consumer-contracts",
3-
"version": "1.0.1",
42
"description": "NHS Notify Supplier API Pact contracts",
5-
"license": "MIT",
6-
"repository": {
7-
"type": "git",
8-
"url": "git+ssh://git@github.com/NHSDigital/nhs-notify-supplier-api.git"
9-
},
103
"exports": {
114
"./pacts/*.json": {
125
"default": "./pacts/*.json"
136
}
147
},
8+
"license": "MIT",
9+
"name": "@nhsdigital/notify-supplier-api-consumer-contracts",
1510
"publishConfig": {
1611
"access": "public",
1712
"registry": "https://npm.pkg.github.com"
1813
},
14+
"repository": {
15+
"type": "git",
16+
"url": "git+ssh://git@github.com/NHSDigital/nhs-notify-supplier-api.git"
17+
},
1918
"scripts": {
2019
"lint": "echo Linting not required",
20+
"lint:fix": "echo Linting not required",
2121
"test:unit": "echo Unit tests not required",
2222
"test:unit:coverage": "echo Unit tests not required",
2323
"typecheck": "echo Typecheck not required"
24-
}
24+
},
25+
"version": "1.0.1"
2526
}

0 commit comments

Comments
 (0)