slackapi / slackapi/bolt-js

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

Open
#858 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

tests TypeScript-specific
Dominant language
TypeScript
Stars
2.9k
Forks
445
Avg merge
1d 3h
Merged PRs (30d)
28

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the TypeScript listener type definitions and the app.view entry point. Add compile-time test cases for the shown SlackViewMiddlewareArgs example and the other explicit listener types, then confirm the tests compile without breaking changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
developer-experience, testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.