Botkit: Testing Botkit Blocks

Created on 21 Dec 2015  路  12Comments  路  Source: howdyai/botkit

I didn't see any examples or documentation on how to write tests for Botkit blocks. Please add!

documentation tests

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.

All 12 comments

@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!

https://github.com/amplicity/BotMock

moving discussion over here https://github.com/howdyai/botkit/issues/850

Was this page helpful?
0 / 5 - 0 ratings

Related issues

abinashmohanty picture abinashmohanty  路  4Comments

JonnyBoy333 picture JonnyBoy333  路  3Comments

imjul1an picture imjul1an  路  3Comments

fieldcorbett picture fieldcorbett  路  4Comments

GautierT picture GautierT  路  3Comments