-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCore.tests.js
36 lines (26 loc) · 1.32 KB
/
Core.tests.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const assert = require('assert');
const { Botkit, TeamsBotWorker } = require('../');
const { TwilioAdapter, TwilioBotWorker } = require('../../botbuilder-adapter-twilio-sms');
describe('Botkit', function() {
it('should create a Botkit controller', function() {
assert((new Botkit({ disable_console: true, disable_webserver: true }) instanceof Botkit), 'Botkit is wrong type');
});
it ('should spawn appropriate bot worker with a single adapter', async function() {
const controller = new Botkit({
disable_webserver: true,
adapter: new TwilioAdapter({enable_incomplete: true}),
});
const bot = await controller.spawn({});
assert((bot instanceof TwilioBotWorker), 'Bot worker is wrong type');
});
it ('should spawn appropriate bot worker with a multiple adapter', async function() {
const controller = new Botkit({
disable_webserver: true,
});
const anotherAdapter = new TwilioAdapter({enable_incomplete: true});
const bot = await controller.spawn({});
assert((bot instanceof TeamsBotWorker), 'Default Bot worker is wrong type');
const tbot = await controller.spawn({}, anotherAdapter);
assert((tbot instanceof TwilioBotWorker), 'Secondary Bot worker is wrong type');
});
});