1.0.8 • Published 7 years ago

botbuilder-calling-test v1.0.8

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

Installation

npm install --save botbuilder-calling-test

Usage

Capture testable events from your bot

import { BotCallRecorder } from 'botbuilder-calling-test';
import { UniversalCallBot } from 'botbuilder-calling';

// your call bot
const bot = new UniversalCallBot(/* params */);

// store audio and events at 'logs'
const recorder = new BotCallRecorder({rootDir:'logs'});

// use recorder with your bot
bot.use(recorder.middleware);

/** run your bot to capture a testable scenario **/

Write tests

import { MockCallConnector } from 'botbuilder-calling-test';

// use nock or other utility to mock responses from Bing Speech and LUIS, if necessary

// read events from captured data
const mockCallConnector = new MockCallConnector({rootDir:'logs'});

mockCallConnector.requestFromFiles([
  'request1.json',
  'request2.json',
], (err, [
  workflow1,
  workflow2,
]) => {
  expect(workflow1.actions[0].action).toBe('answer');
  expect(workflow2.actions[0].playPrompt.prompts[0].value).toBe('some prompt');
});
1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago