Skip to content

Instantly share code, notes, and snippets.

@microsoftly
Last active August 29, 2017 00:21
Show Gist options
  • Save microsoftly/98cc86b707bb61c9758185f7582cc00c to your computer and use it in GitHub Desktop.
Save microsoftly/98cc86b707bb61c9758185f7582cc00c to your computer and use it in GitHub Desktop.
const { BotTester } = require('bot-tester');
const { expect } = require('chai');
describe('Bot Tester', () => {
it('accepts RegExp', () => {
const numberRegex = /^\d+/;
bot.dialog('/', (session) => {
session.send(session.message.text);
});
return new BotTester(bot)
.sendMessageToBot('1', numberRegex)
.sendMessageToBot('3156', numberRegex)
.sendMessageToBot('8675309', numberRegex)
.runTest();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment