Skip to content

Commit

Permalink
Fix snaps-sdk tests by applying @ts-expect-error annotations to d…
Browse files Browse the repository at this point in the history
…eliberately invalid inputs
  • Loading branch information
MajorLift committed Jun 24, 2024
1 parent d0d7b3c commit ee64dbd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/snaps-sdk/src/ui/components/image.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
);
Expand Down

0 comments on commit ee64dbd

Please sign in to comment.