Skip to content

Commit 6bacb24

Browse files
authored
test(parser): fixed failing tests after zod version bump to 4.0.14 (#4240)
1 parent a73b359 commit 6bacb24

File tree

5 files changed

+38
-10
lines changed

5 files changed

+38
-10
lines changed

examples/snippets/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"@valkey/valkey-glide": "^2.0.1",
4444
"aws-sdk": "^2.1692.0",
4545
"aws-sdk-client-mock": "^4.1.0",
46-
"zod": "^4.0.5"
46+
"zod": "^4.0.14"
4747
},
4848
"dependencies": {
4949
"arktype": "^2.1.20",

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/kafka/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,6 @@
117117
"devDependencies": {
118118
"avro-js": "^1.12.0",
119119
"protobufjs": "^7.5.3",
120-
"zod": "^4.0.5"
120+
"zod": "^4.0.14"
121121
}
122122
}

packages/parser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,6 @@
216216
}
217217
},
218218
"devDependencies": {
219-
"zod": "^4.0.5"
219+
"zod": "^4.0.14"
220220
}
221221
}

packages/parser/tests/unit/envelopes/cloudwatch.test.ts

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ describe('Envelope: CloudWatch', () => {
144144
});
145145
});
146146

147-
it('returns an error if the event is not a valid CloudWatch Logs event', () => {
147+
it('returns an error if the event is not a valid CloudWatch Logs event (invalid base64 passed in the data property)', () => {
148148
// Prepare
149149
const event = {
150150
awslogs: {
@@ -171,6 +171,34 @@ describe('Envelope: CloudWatch', () => {
171171
path: ['awslogs', 'data'],
172172
message: 'Invalid base64-encoded string',
173173
},
174+
],
175+
}),
176+
}),
177+
originalEvent: event,
178+
});
179+
});
180+
181+
it('returns an error if the event is not a valid CloudWatch Logs event (valid base64 passed but invalid JSON in the payload)', () => {
182+
// Prepare
183+
const event = {
184+
awslogs: {
185+
data: 'eyJ0ZXN0IjoidGVzdCJ9',
186+
},
187+
};
188+
189+
// Act
190+
const result = CloudWatchEnvelope.safeParse(event, z.object({}));
191+
192+
// Assess
193+
expect(result).toEqual({
194+
success: false,
195+
error: expect.objectContaining({
196+
name: 'ParseError',
197+
message: expect.stringContaining(
198+
'Failed to parse CloudWatch Log envelope'
199+
),
200+
cause: expect.objectContaining({
201+
issues: [
174202
{
175203
code: 'custom',
176204
message: 'Failed to decompress CloudWatch log data',

0 commit comments

Comments
 (0)