bolt-js
bolt-js copied to clipboard
Write more tests for verifying the developer experience using listener types in TypeScript
Description
We can have tests verifying all explicit types of listeners are available in TypeScript. For instance, for view_submission handling, the following code would be the case. I haven't checked all others yet but having TS tests like this helps us detect breaking changes and also share examples when answering questions.
import { App, Middleware, SlackViewMiddlewareArgs, ViewSubmitAction } from '@slack/bolt';
const app = new App({
token: process.env.SLACK_BOT_TOKEN,
signingSecret: process.env.SLACK_SIGNING_SECRET
});
const modalListener: Middleware<SlackViewMiddlewareArgs<ViewSubmitAction>> = async ({ ack }) => {
await ack();
};
app.view("modal", modalListener);
What type of issue is this? (place an x in one of the [ ])
- [x] bug
- [x] enhancement (feature request)
- [ ] question
- [ ] documentation related
- [ ] example code related
- [x] testing related
- [ ] discussion
Requirements (place an x in each of the [ ])
- [x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
- [x] I've read and agree to the Code of Conduct.
- [x] I've searched for any related issues and avoided creating a duplicate issue.
We have some of these in types-tests already.. we definitely need more, and as we work on bolt v4/v5 we will certainly do so.
Actually going to re-open this and assign this to the v5 milestone.