Skip to content

Commit a16f810

Browse files
authored
test: add test for forbidden sqs payload unicode char (#226)
1 parent 4af7707 commit a16f810

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/sqs/test/publishers/SqsPermissionPublisher.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,17 @@ describe('SqsPermissionPublisher', () => {
269269
).rejects.toThrow(/Unsupported message type: bad/)
270270
})
271271

272+
// See https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html
273+
it('publish message with payload containing forbidden unicode character', async () => {
274+
await expect(
275+
permissionPublisher.publish({
276+
id: '\uFFFF',
277+
messageType: 'add',
278+
timestamp: new Date().toISOString(),
279+
} satisfies PERMISSIONS_ADD_MESSAGE_TYPE),
280+
).rejects.toThrow(/Error while publishing to SQS: Invalid characters found/)
281+
})
282+
272283
it('publishes a message', async () => {
273284
const { permissionPublisher } = diContainer.cradle
274285

0 commit comments

Comments
 (0)