Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ZodError matching for AMQP consumer test #179

Merged
merged 2 commits into from
Jun 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Lint fix
andrewi-wd committed Jun 27, 2024

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit 316bc44e71d2ca9350ec816117a44430c213e2cf
7 changes: 2 additions & 5 deletions packages/amqp/test/consumers/AmqpPermissionConsumer.spec.ts
Original file line number Diff line number Diff line change
@@ -308,7 +308,7 @@ describe('AmqpPermissionConsumer', () => {
// @ts-ignore
publisher.publish(invalidMessage),
).toThrowErrorMatchingInlineSnapshot(
`
`
[ZodError: [
{
"code": "invalid_type",
@@ -323,10 +323,7 @@ describe('AmqpPermissionConsumer', () => {
`,
)

channel.sendToQueue(
AmqpPermissionConsumer.QUEUE_NAME,
objectToBuffer(invalidMessage),
)
channel.sendToQueue(AmqpPermissionConsumer.QUEUE_NAME, objectToBuffer(invalidMessage))

await waitAndRetry(() => consumerErrorResolver.errors.length > 0)

3 changes: 2 additions & 1 deletion packages/sqs/lib/utils/sqsUtils.ts
Original file line number Diff line number Diff line change
@@ -12,7 +12,8 @@ import type {
QueueAttributeName,
SendMessageCommandInput,
} from '@aws-sdk/client-sqs'
import {Either, globalLogger} from '@lokalise/node-core'
import type { Either} from '@lokalise/node-core';
import { globalLogger } from '@lokalise/node-core'
import { isShallowSubset, waitAndRetry } from '@message-queue-toolkit/core'

import type { ExtraSQSCreationParams, SQSQueueLocatorType } from '../sqs/AbstractSqsService'