botbuilder-calling-test
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

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');
});

Readme

Keywords

none

Package Sidebar

Install

npm i botbuilder-calling-test

Weekly Downloads

0

Version

1.0.8

License

MIT

Last publish

Collaborators

  • ctstone