botbuilder-unit
Version:
Unit tests for chatbot dialogs
174 lines (173 loc) • 5.71 kB
HTML
<html lang="en">
<head>
<title>Code coverage report for botbuilder-unit/src/ScriptStepFactory.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../../index.html">All files</a> / <a href="index.html">botbuilder-unit/src</a> ScriptStepFactory.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">95.65% </span>
<span class="quiet">Statements</span>
<span class='fraction'>22/23</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">94.12% </span>
<span class="quiet">Branches</span>
<span class='fraction'>16/17</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">50% </span>
<span class="quiet">Functions</span>
<span class='fraction'>1/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">95.65% </span>
<span class="quiet">Lines</span>
<span class='fraction'>22/23</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">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
37</td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">200x</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">200x</span>
<span class="cline-any cline-yes">116x</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">84x</span>
<span class="cline-any cline-yes">84x</span>
<span class="cline-any cline-yes">69x</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">15x</span>
<span class="cline-any cline-yes">15x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-yes">3x</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1x</span></td><td class="text"><pre class="prettyprint lang-js">/* jslint es6 */
'use strict';
const BotMessage = require('./messages/BotMessage');
const CustomMessage = require('./messages/CustomMessage');
const UserMessage = require('./messages/UserMessage');
const SessionMessage = require('./messages/SessionMessage');
const SetDialogMessage = require('./messages/SetDialogMessage');
function <span class="fstat-no" title="function not covered" >MessageFactory(</span>) {
}
MessageFactory.produce = function (step, config, bot, logReporter, prevStepPromise) {
let isBot = config.bot || config.endConversation || config.typing
|| config.attachmentLayout || config.attachments;
if (isBot) {
return new BotMessage(step, config, bot, logReporter, prevStepPromise);
}
let isUser = "undefined" != typeof config.user;
if (isUser) {
return new UserMessage(step, config, bot, logReporter, prevStepPromise)
}
let isSession = "undefined" != typeof config.session;
if (isSession) {
return new SessionMessage(step, config, bot, logReporter, prevStepPromise);
}
let isSetDialog = ("undefined" != typeof config.dialog) || ("undefined" != typeof config.args );
if (isSetDialog) {
return new SetDialogMessage(step, config, bot, logReporter, prevStepPromise)
}
let isCustomDialog = "function" === typeof config.custom;
<span class="missing-if-branch" title="else path not taken" >E</span>if (isCustomDialog) {
return new CustomMessage(step, config, bot, logReporter, prevStepPromise)
}
<span class="cstat-no" title="statement not covered" > throw new Error('Unsupported config - ' + JSON.stringify(config));</span>
}
module.exports = MessageFactory;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Feb 27 2018 06:41:45 GMT+0300 (+03)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>