I didn't see any examples or documentation on how to write tests for Botkit blocks. Please add!
@ghostsquad We don't have any system for testing yet -- would you be interested in submitting a PR with one?
How did you test Botkit? manual testing?
You can mock the Slacks API responses and make Botkit think that it is connecting with Slack @ghostsquad
@ghostsquad we don't yet have a solid testing system for Botkit and would love help implementing one. We do have a couple of tests. For example, we test storage modules using storage/storage_test.js.
It should be noted that storage options are now in separate repos/modules and have tests using stubs etc against them.
I think the best way is to use a web-token and code some command issuing layer over some like slack-cli slack client for command line. We can catch answers from bot, we can speak in different ambients, and also it's not need to fake each crucial function nor objects. I just was reading a test for an hour, that is using near to 4 libraries, and I had to do a lot of effort to understand just a % of the whole testing scripts. What do you think?
Hey guys, I too am curious as to what people are doing to automatically test their bot/conversation logic, other than connecting it to Slack and manually interacting with it.
Does anyone have example code with a mocked up Slack API or a mocked up conversation object used in automated tests?
I've got it! I am using nightmare, it works like a charm. But need coding.
My team has created a mock for mocking botkit conversations. We have been using that internally for automated testing with mocha. We're running some checks to see how fit it would be for botkit as a whole..will cycle back and push a fork if it's applicable.
@amplicity that sounds cool, looking forward to it. Feel free to share your process even if you don't think it belongs inside of botkit, perhaps via another repo or a blog post.
@nikbora As referenced above, our team has been internally using a mock solution to test botkit conversations and api responses.
I've uploaded our mock and some test examples to the repo below. hope this is helpful!
moving discussion over here https://github.com/howdyai/botkit/issues/850
Most helpful comment
My team has created a mock for mocking botkit conversations. We have been using that internally for automated testing with mocha. We're running some checks to see how fit it would be for botkit as a whole..will cycle back and push a fork if it's applicable.