-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
subscribe to throw when listener is not a function #1325
Conversation
|
||
expect(() => | ||
store.subscribe() | ||
).toThrow() |
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.
Let's check a few more data types: null, undefined, and string should throw.
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.
Added a few extra checks for the types mentioned. I've gone with the assertion style I've seen elsewhere rather than something like:
const cases = [undefined, null, ''];
cases.map(arg =>
expect(() =>
store.subscribe(arg))
.toThrow())
|
||
expect(() => | ||
store.subscribe(undefined) | ||
).toThrow() |
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.
Nit: please remove the extra newline
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.
+1 removed in latest commit.
subscribe to throw when listener is not a function
Out in 3.1.6, thanks! |
Fixes: #1324