-
Notifications
You must be signed in to change notification settings - Fork 399
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 #1148 - Adjust the app.message listener interface in TypeScript to compile the examples in documents #1185
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1185 +/- ##
==========================================
- Coverage 71.42% 71.33% -0.10%
==========================================
Files 17 17
Lines 1414 1399 -15
Branches 424 415 -9
==========================================
- Hits 1010 998 -12
+ Misses 332 331 -1
+ Partials 72 70 -2
Continue to review full report at Codecov.
|
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.
HI @M1kep, thanks for taking the time to make this pull request! Would you mind writing some test code that just verifies the mentioned patterns compile in TypeScript?
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.
Agreed with @seratch, looks good, but some tests covering the new overload, for example, would be much appreciated.
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.
This looks great! Thanks for adding all of the helpful comments. If you need help with the tests, let us know!
@stevengill Re Tests: If you're able to provide a basic example, or point me in the right direction of similar tests that'd be awesome! Otherwise, I was planning on spending some time to review Mocha and Sinon libraries |
@M1kep I wonder if the type tests we have would be useful here? https://github.com/slackapi/bolt-js/blob/main/types-tests/message.test-d.ts |
To open this method up to TypeScript users a required either removing the two existing overloads, or creating new overloads. Hopefully by providing additional overloads as well as inline documentation, this can provide assistance as well as control Fixes slackapi#1148
d284b2b
to
ed9de56
Compare
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.
LGTM, thanks for adding the comprehensive test patterns here 👍 Before merging this, let me wait for other maintainers' reviews for a few more business days.
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.
Very well done! Thanks so much for adding such thorough and well organized tests - it makes our lives much easier!
}; | ||
|
||
const assertMiddlewaresCalledOrder = () => { | ||
sinon.assert.callOrder(...fakeMiddlewares); |
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.
Sweet, things I learned today: sinon.assert.callOrder
! Super handy!
Summary
The goal of this PR is to provide Typescript users the ability to fully utilize the
App.message
method, while still providing common use case overloads with documentation.Fixes #1148
Requirements (place an
x
in each[ ]
)