Skip to content

Commit

Permalink
Apply @ts-expect-error directives to test runtime error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
MajorLift committed Jul 6, 2024
1 parent a709936 commit 1dc7108
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 error 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 error 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 1dc7108

Please sign in to comment.