For automated testing of bots in Node.js, using the ConsoleConnector, just like the tests in BotBuilder on GitHub work well, for example. take a look at https://github.com/Microsoft/BotBuilder/blob/master/Node/core/tests/localization.js :
var assert = require('assert'); var builder = require('../'); describe('localization', function() { this.timeout(5000); it('should return localized prompt when found', function (done) { var connector = new builder.ConsoleConnector(); var bot = new builder.UniversalBot(connector); bot.dialog('/', function (session, args) { session.send('id1'); }); bot.on('send', function (message) { assert(message.text === 'index-en1'); done(); }); connector.processMessage('test'); });
... etc...
source share