Socket
Book a DemoInstallSign in
Socket

botbuilder-calling-test

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

botbuilder-calling-test

Testing utilities for botbuilder-calling

1.0.8
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 03 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.