Last active
August 29, 2017 00:21
-
-
Save microsoftly/9a91591e127056875dc3d7e35a5ade51 to your computer and use it in GitHub Desktop.
BotTester testing expected responses with strings only
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { BotTester } = require('bot-tester'); | |
| const { expect } = require('chai'); | |
| describe('Bot Tester', () => { | |
| it('can test prompts', () => { | |
| bot.dialog('/', [(session) => { | |
| new Prompts.text(session, 'Hi there! Tell me something you like'); | |
| }, (session, results) => { | |
| session.send(`${results.response} is pretty cool.`); | |
| new Prompts.text(session, 'Why do you like it?'); | |
| }, (session) => session.send('Interesting. Well, that\'s all I have for now')]); | |
| return new BotTester(bot) | |
| .sendMessageToBot('Hola!', 'Hi there! Tell me something you like') | |
| .sendMessageToBot('The sky', 'The sky is pretty cool.', 'Why do you like it?') | |
| .sendMessageToBot('It\'s blue', 'Interesting. Well, that\'s all I have for now') | |
| .runTest(); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment