Skip to content

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

@seratch

Description

@seratch

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

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • example code related
  • testing related
  • discussion

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

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions