Skip to content
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

Please add some unit tests for project based on slack bolt in this repo. #6

Open
mudasirmirza opened this issue Apr 6, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@mudasirmirza
Copy link

Please add some unit tests, I am unable to find any example anywhere. I created a python bot based on this template but not able to find any example of any unit test based on slack bolt.

@misscoded misscoded added the enhancement New feature or request label Apr 6, 2022
@misscoded
Copy link
Collaborator

Hi @mudasirmirza! Thanks for submitting this request. Providing a sample testing setup has been something we've discussed in the past, however, there is some work to be done regarding creating a testing utility to accomplish this end.

In the meantime, you might find the conversation within this issue useful.

@I-Dont-Remember
Copy link

I-Dont-Remember commented Dec 5, 2022

If it helps those who stumble on this in the future, this is an open-source Bolt app with a moderately sized test suite as an example to dig through.

We've taken the approach of keeping our core functionality in a separate module that doesn't depend on slack_bolt, letting us easily run unit tests without dealing with bolt trying to start a server or anything like that.

Then in app.py you can just import the module and use the Slack @decorated functions essentially as wrappers over your unit-testable business logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants