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
Simplify controller tests #983
Conversation
9ae617f
to
37b2097
Compare
Codecov Report
@@ Coverage Diff @@
## main #983 +/- ##
=======================================
Coverage 92.94% 92.94%
=======================================
Files 96 96
Lines 9578 9578
Branches 903 903
=======================================
Hits 8902 8902
Misses 676 676 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
3f3cc6e
to
e839959
Compare
|
||
expect( | ||
// Race the promises to check that handlerPromise does not time out | ||
await Promise.race([handlerPromise, timeoutPromise]), | ||
).toBe(true); | ||
).toBe('test1'); |
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.
Where does test1
come from here?
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.
From DEFAULT_SNAP_BUNDLE
. It returns method + id
.
@@ -1109,14 +1058,16 @@ describe('SnapController', () => { | |||
id: 1, | |||
}, | |||
}), | |||
).toBe(21896430); | |||
).toBe(21896426); |
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.
How is this returning a number? 🤔
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.
I don't know. It was doing it before too though.
This reverts commit 3252375.
a1b2681
to
73ce156
Compare
Rather than mocking messenger calls, I've changed the tests to use
registerActionHandler
. This has a few benefits: