slackapi / bolt-js

A framework to build Slack apps using JavaScript
https://tools.slack.dev/bolt-js/
MIT License
2.75k stars 395 forks source link

Write more tests for verifying the developer experience using listener types in TypeScript #858

Open seratch opened 3 years ago

seratch commented 3 years ago

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 [ ])

Requirements (place an x in each of the [ ])

filmaj commented 2 months ago

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.

filmaj commented 2 months ago

Actually going to re-open this and assign this to the v5 milestone.