Skip to content

Instantly share code, notes, and snippets.

@microsoftly
Created August 28, 2017 23:44
Show Gist options
  • Save microsoftly/04045555211774328e296196ae82b27e to your computer and use it in GitHub Desktop.
Save microsoftly/04045555211774328e296196ae82b27e to your computer and use it in GitHub Desktop.
familiar .then syntax can be used between test steps
const { BotTester } = require('bot-tester');
const { expect } = require('chai');
describe('Bot Tester', () => {
it('can do arbitrary work between test steps', () => {
let responseString = 'goodbye';
bot.dialog('/', (session) => {
// send only numbers for this test case ....
session.send(responseString);
});
return new BotTester(bot)
.sendMessageToBot('you say', 'goodbye')
.then(() => responseString = 'hello')
.sendMessageToBot('and i say', 'hello')
.runTest();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment