-
Notifications
You must be signed in to change notification settings - Fork 558
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
fix: properly handle invalid interfaces during test #2433
Conversation
2a06327
to
fffea18
Compare
@@ -60,6 +72,12 @@ export function handleRequest({ | |||
runSaga, | |||
request: { id = nanoid(), origin = 'https://metamask.io', ...options }, | |||
}: HandleRequestOptions): SnapRequest { | |||
const getInterfaceError = () => { | |||
throw new Error( | |||
'Unable to get the interface from the Snap: The returned interface may be invalid.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this error makes sense if the entire request failed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unable to get the interface from the Snap: The request to the Snap failed.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2433 +/- ##
=======================================
Coverage 94.31% 94.32%
=======================================
Files 438 438
Lines 9001 9016 +15
Branches 1379 1382 +3
=======================================
+ Hits 8489 8504 +15
Misses 512 512 ☔ View full report in Codecov by Sentry. |
When using
.getInterface()
with a Snap that produces an invalid interface, the tests would previously time out. This PR aims to catch the problem and fail sooner with a better error message.