Skip to content

Commit b994b2b

Browse files
committed
fix test
1 parent f1a154d commit b994b2b

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
/* eslint-disable no-undef */
2-
process.env.TABLE_NAME = "dummy_table";
32
process.env.NHS_NOTIFY_PRESCRIPTIONS_SQS_QUEUE_URL = "dummy_notify_sqs";
43
process.env.AWS_REGION = "eu-west-2";

packages/updatePrescriptionStatus/src/utils/sqsClient.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import {Logger} from "@aws-lambda-powertools/logger"
12
import {SQSClient, SendMessageBatchCommand} from "@aws-sdk/client-sqs"
3+
24
import {v4} from "uuid"
35

4-
import {Logger} from "@aws-lambda-powertools/logger"
56
import {DataItem} from "../updatePrescriptionStatus"
67

78
const sqsUrl = process.env.NHS_NOTIFY_PRESCRIPTIONS_SQS_QUEUE_URL
@@ -37,11 +38,9 @@ export async function pushPrescriptionToNotificationSQS(data: Array<DataItem>, l
3738
const batches = chunkArray(data, 10)
3839

3940
for (const batch of batches) {
40-
// Create SQS entries. Each message is required to have an unique Id string.
41-
// TODO: I'm creating a new UUID here, but am I safe to use the lineID? It looks like it should be unique
41+
// Create SQS messages. For each message, generate a new UUID
4242
const entries = batch.map((item) => ({
4343
Id: v4().toUpperCase(),
44-
// Id: item.LineItemID || v4().toUpperCase(),
4544
MessageBody: JSON.stringify(item)
4645
}))
4746

packages/updatePrescriptionStatus/tests/testHandler.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ import {QueryCommand, TransactionCanceledException, TransactWriteItemsCommand} f
3939

4040
const {mockSend: dynamoDBMockSend} = mockDynamoDBClient()
4141
const {mockSend: sqsMockSend} = mockSQSClient()
42+
4243
const {handler, logger} = await import("../src/updatePrescriptionStatus")
44+
4345
const LAMBDA_TIMEOUT_MS = 9500 // 9.5 sec
4446

4547
describe("Integration tests for updatePrescriptionStatus handler", () => {

0 commit comments

Comments
 (0)