Last active
August 28, 2017 23:53
-
-
Save microsoftly/14624c4ad73365dfd9a880b3d9f5215d to your computer and use it in GitHub Desktop.
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'); | |
const defaultAddress = { channelId: 'console', | |
user: { id: 'user1', name: 'A' }, | |
bot: { id: 'bot', name: 'Bot' }, | |
conversation: { id: 'user1Conversation' } | |
}; | |
describe ('Bot Tester', () => { | |
it('can send IMessages to the bot and expect IMessage or string responses', () => { | |
bot.dialog('/', (session) => session.send(session.message.address.user.name)); | |
const askForUser1Name = new Message() | |
.text('What is my name?') | |
.address(defaultAddress) | |
.toMessage(); | |
const user1ExpectedResponse = new Message() | |
.text('A') | |
.address(defaultAddress) | |
.toMessage(); | |
return new BotTester(bot, defaultAddress) | |
.sendMessageToBot(askForUser1Name, 'A') | |
.sendMessageToBot(askForUser1Name, user1ExpectedResponse) | |
.runTest(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment