From ee64dbd85d8a8c9fad1a189eee356869cff40603 Mon Sep 17 00:00:00 2001 From: Jongsun Suh Date: Fri, 14 Jun 2024 13:09:00 -0400 Subject: [PATCH] Fix `snaps-sdk` tests by applying `@ts-expect-error` annotations to deliberately invalid inputs --- packages/snaps-sdk/src/ui/components/image.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/snaps-sdk/src/ui/components/image.test.ts b/packages/snaps-sdk/src/ui/components/image.test.ts index c5f2a05287..76619ec467 100644 --- a/packages/snaps-sdk/src/ui/components/image.test.ts +++ b/packages/snaps-sdk/src/ui/components/image.test.ts @@ -23,10 +23,12 @@ describe('image', () => { 'Invalid image component: At path: value -- Value is not a valid SVG.', ); + // @ts-expect-error - Suppressing type error to test runtime handling of invalid input expect(() => image({ value: MOCK_SVG, bar: 'baz' })).toThrow( 'Invalid image component: At path: bar -- Expected a value of type `never`, but received: `"baz"`.', ); + // @ts-expect-error - Suppressing type error to test runtime handling of invalid input expect(() => image({})).toThrow( 'Invalid image component: At path: value -- Expected a string, but received: undefined.', );