@sprucelabs/spruce-conversation-plugin 62.2.24 → 62.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +17 -17
- package/build/__tests__/behavioral/CheckingHealth.test.d.ts +0 -10
- package/build/__tests__/behavioral/CheckingHealth.test.js +0 -87
- package/build/__tests__/behavioral/KillingASkill.test.d.ts +0 -4
- package/build/__tests__/behavioral/KillingASkill.test.js +0 -29
- package/build/__tests__/behavioral/RegisteringConversationsOnBoot.test.d.ts +0 -13
- package/build/__tests__/behavioral/RegisteringConversationsOnBoot.test.js +0 -147
- package/build/__tests__/behavioral/RespondingToMessages.test.d.ts +0 -13
- package/build/__tests__/behavioral/RespondingToMessages.test.js +0 -134
- package/build/__tests__/behavioral/TestingAConversation.test.d.ts +0 -14
- package/build/__tests__/behavioral/TestingAConversation.test.js +0 -110
- package/build/__tests__/implementation/ConversationCoordinator.test.d.ts +0 -18
- package/build/__tests__/implementation/ConversationCoordinator.test.js +0 -185
- package/build/__tests__/implementation/MessageGraphicsInterface/EmailField.test.d.ts +0 -7
- package/build/__tests__/implementation/MessageGraphicsInterface/EmailField.test.js +0 -73
- package/build/__tests__/implementation/MessageGraphicsInterface/MessageGraphicsInterface.test.d.ts +0 -4
- package/build/__tests__/implementation/MessageGraphicsInterface/MessageGraphicsInterface.test.js +0 -42
- package/build/__tests__/implementation/MessageGraphicsInterface/MockMessageBeforeAndAfterEach.test.d.ts +0 -5
- package/build/__tests__/implementation/MessageGraphicsInterface/MockMessageBeforeAndAfterEach.test.js +0 -62
- package/build/__tests__/implementation/MessageGraphicsInterface/MockMessageInterface.test.d.ts +0 -18
- package/build/__tests__/implementation/MessageGraphicsInterface/MockMessageInterface.test.js +0 -168
- package/build/__tests__/implementation/MessageGraphicsInterface/SelectField.test.d.ts +0 -7
- package/build/__tests__/implementation/MessageGraphicsInterface/SelectField.test.js +0 -71
- package/build/__tests__/implementation/MessageGraphicsInterface/TextField.test.d.ts +0 -6
- package/build/__tests__/implementation/MessageGraphicsInterface/TextField.test.js +0 -48
- package/build/__tests__/implementation/ScriptTester.test.d.ts +0 -19
- package/build/__tests__/implementation/ScriptTester.test.js +0 -461
- package/build/__tests__/implementation/SuggesterUtil.test.d.ts +0 -7
- package/build/__tests__/implementation/SuggesterUtil.test.js +0 -63
- package/build/__tests__/implementation/TopicLoader.test.d.ts +0 -8
- package/build/__tests__/implementation/TopicLoader.test.js +0 -66
- package/build/__tests__/implementation/TopicScriptPlayer.test.d.ts +0 -23
- package/build/__tests__/implementation/TopicScriptPlayer.test.js +0 -436
- package/build/__tests__/implementation/TopicSuggester.test.d.ts +0 -8
- package/build/__tests__/implementation/TopicSuggester.test.js +0 -137
- package/build/__tests__/testDirsAndFiles/bad-empty/conversations/bookAppointment.topic.d.ts +0 -0
- package/build/__tests__/testDirsAndFiles/bad-empty/conversations/bookAppointment.topic.js +0 -1
- package/build/__tests__/testDirsAndFiles/bad-missing-params/conversations/bookAppointment.topic.d.ts +0 -2
- package/build/__tests__/testDirsAndFiles/bad-missing-params/conversations/bookAppointment.topic.js +0 -4
- package/build/__tests__/testDirsAndFiles/bad-skill/build/.spruce/events/listeners.d.ts +0 -2
- package/build/__tests__/testDirsAndFiles/bad-skill/build/.spruce/events/listeners.js +0 -3
- package/build/__tests__/testDirsAndFiles/bad-skill/build/conversations/bookAppointment.topic.d.ts +0 -2
- package/build/__tests__/testDirsAndFiles/bad-skill/build/conversations/bookAppointment.topic.js +0 -4
- package/build/__tests__/testDirsAndFiles/empty-skill/build/.spruce/events/listeners.d.ts +0 -2
- package/build/__tests__/testDirsAndFiles/empty-skill/build/.spruce/events/listeners.js +0 -3
- package/build/__tests__/testDirsAndFiles/good/conversations/bookAppointment.topic.d.ts +0 -3
- package/build/__tests__/testDirsAndFiles/good/conversations/bookAppointment.topic.js +0 -8
- package/build/__tests__/testDirsAndFiles/good/conversations/cancelAppointment.topic.d.ts +0 -3
- package/build/__tests__/testDirsAndFiles/good/conversations/cancelAppointment.topic.js +0 -12
- package/build/__tests__/testDirsAndFiles/skill/build/.spruce/events/listeners.d.ts +0 -2
- package/build/__tests__/testDirsAndFiles/skill/build/.spruce/events/listeners.js +0 -3
- package/build/__tests__/testDirsAndFiles/skill/build/conversations/bookAppointment.topic.d.ts +0 -3
- package/build/__tests__/testDirsAndFiles/skill/build/conversations/bookAppointment.topic.js +0 -8
- package/build/__tests__/testDirsAndFiles/skill/build/conversations/cancelAppointment.topic.d.ts +0 -3
- package/build/__tests__/testDirsAndFiles/skill/build/conversations/cancelAppointment.topic.js +0 -12
- package/build/__tests__/testDirsAndFiles/skill/build/conversations/favoriteColor.topic.d.ts +0 -3
- package/build/__tests__/testDirsAndFiles/skill/build/conversations/favoriteColor.topic.js +0 -21
- package/build/__tests__/testDirsAndFiles/skill/build/conversations/favoriteColorTopicChanger.topic.d.ts +0 -3
- package/build/__tests__/testDirsAndFiles/skill/build/conversations/favoriteColorTopicChanger.topic.js +0 -21
- package/build/__tests__/testDirsAndFiles/skill/build/conversations/mixedStringsAndCallbacks.topic.d.ts +0 -3
- package/build/__tests__/testDirsAndFiles/skill/build/conversations/mixedStringsAndCallbacks.topic.js +0 -29
- package/build/__tests__/testDirsAndFiles/skill-assertions/build/.spruce/events/listeners.d.ts +0 -2
- package/build/__tests__/testDirsAndFiles/skill-assertions/build/.spruce/events/listeners.js +0 -3
- package/build/__tests__/testDirsAndFiles/skill-assertions/build/conversations/assertsScriptCallbackOptions.topic.d.ts +0 -3
- package/build/__tests__/testDirsAndFiles/skill-assertions/build/conversations/assertsScriptCallbackOptions.topic.js +0 -22
- package/build/__tests__/testDirsAndFiles/skill-assertions/build/conversations/assertsScriptOnlyCalledOnce.topic.d.ts +0 -3
- package/build/__tests__/testDirsAndFiles/skill-assertions/build/conversations/assertsScriptOnlyCalledOnce.topic.js +0 -14
- package/build/__tests__/testDirsAndFiles/skill-with-one-topic/build/.spruce/events/listeners.d.ts +0 -2
- package/build/__tests__/testDirsAndFiles/skill-with-one-topic/build/.spruce/events/listeners.js +0 -3
- package/build/__tests__/testDirsAndFiles/skill-with-one-topic/build/conversations/bookAppointment.topic.d.ts +0 -3
- package/build/__tests__/testDirsAndFiles/skill-with-one-topic/build/conversations/bookAppointment.topic.js +0 -8
- package/build/__tests__/testDirsAndFiles/skill-with-script-that-throws/build/.spruce/events/listeners.d.ts +0 -2
- package/build/__tests__/testDirsAndFiles/skill-with-script-that-throws/build/.spruce/events/listeners.js +0 -3
- package/build/__tests__/testDirsAndFiles/skill-with-script-that-throws/build/conversations/cancelAppointment.topic.d.ts +0 -3
- package/build/__tests__/testDirsAndFiles/skill-with-script-that-throws/build/conversations/cancelAppointment.topic.js +0 -16
- package/build/esm/__tests__/behavioral/CheckingHealth.test.d.ts +0 -10
- package/build/esm/__tests__/behavioral/CheckingHealth.test.js +0 -104
- package/build/esm/__tests__/behavioral/KillingASkill.test.d.ts +0 -4
- package/build/esm/__tests__/behavioral/KillingASkill.test.js +0 -34
- package/build/esm/__tests__/behavioral/RegisteringConversationsOnBoot.test.d.ts +0 -13
- package/build/esm/__tests__/behavioral/RegisteringConversationsOnBoot.test.js +0 -171
- package/build/esm/__tests__/behavioral/RespondingToMessages.test.d.ts +0 -13
- package/build/esm/__tests__/behavioral/RespondingToMessages.test.js +0 -158
- package/build/esm/__tests__/behavioral/TestingAConversation.test.d.ts +0 -14
- package/build/esm/__tests__/behavioral/TestingAConversation.test.js +0 -137
- package/build/esm/__tests__/implementation/ConversationCoordinator.test.d.ts +0 -18
- package/build/esm/__tests__/implementation/ConversationCoordinator.test.js +0 -214
- package/build/esm/__tests__/implementation/MessageGraphicsInterface/EmailField.test.d.ts +0 -7
- package/build/esm/__tests__/implementation/MessageGraphicsInterface/EmailField.test.js +0 -84
- package/build/esm/__tests__/implementation/MessageGraphicsInterface/MessageGraphicsInterface.test.d.ts +0 -4
- package/build/esm/__tests__/implementation/MessageGraphicsInterface/MessageGraphicsInterface.test.js +0 -47
- package/build/esm/__tests__/implementation/MessageGraphicsInterface/MockMessageBeforeAndAfterEach.test.d.ts +0 -5
- package/build/esm/__tests__/implementation/MessageGraphicsInterface/MockMessageBeforeAndAfterEach.test.js +0 -47
- package/build/esm/__tests__/implementation/MessageGraphicsInterface/MockMessageInterface.test.d.ts +0 -18
- package/build/esm/__tests__/implementation/MessageGraphicsInterface/MockMessageInterface.test.js +0 -172
- package/build/esm/__tests__/implementation/MessageGraphicsInterface/SelectField.test.d.ts +0 -7
- package/build/esm/__tests__/implementation/MessageGraphicsInterface/SelectField.test.js +0 -80
- package/build/esm/__tests__/implementation/MessageGraphicsInterface/TextField.test.d.ts +0 -6
- package/build/esm/__tests__/implementation/MessageGraphicsInterface/TextField.test.js +0 -57
- package/build/esm/__tests__/implementation/ScriptTester.test.d.ts +0 -19
- package/build/esm/__tests__/implementation/ScriptTester.test.js +0 -470
- package/build/esm/__tests__/implementation/SuggesterUtil.test.d.ts +0 -7
- package/build/esm/__tests__/implementation/SuggesterUtil.test.js +0 -74
- package/build/esm/__tests__/implementation/TopicLoader.test.d.ts +0 -8
- package/build/esm/__tests__/implementation/TopicLoader.test.js +0 -79
- package/build/esm/__tests__/implementation/TopicScriptPlayer.test.d.ts +0 -23
- package/build/esm/__tests__/implementation/TopicScriptPlayer.test.js +0 -477
- package/build/esm/__tests__/implementation/TopicSuggester.test.d.ts +0 -8
- package/build/esm/__tests__/implementation/TopicSuggester.test.js +0 -130
- package/build/esm/__tests__/testDirsAndFiles/bad-empty/conversations/bookAppointment.topic.d.ts +0 -0
- package/build/esm/__tests__/testDirsAndFiles/bad-empty/conversations/bookAppointment.topic.js +0 -1
- package/build/esm/__tests__/testDirsAndFiles/bad-missing-params/conversations/bookAppointment.topic.d.ts +0 -2
- package/build/esm/__tests__/testDirsAndFiles/bad-missing-params/conversations/bookAppointment.topic.js +0 -2
- package/build/esm/__tests__/testDirsAndFiles/bad-skill/build/conversations/bookAppointment.topic.d.ts +0 -2
- package/build/esm/__tests__/testDirsAndFiles/bad-skill/build/conversations/bookAppointment.topic.js +0 -2
- package/build/esm/__tests__/testDirsAndFiles/good/conversations/bookAppointment.topic.d.ts +0 -3
- package/build/esm/__tests__/testDirsAndFiles/good/conversations/bookAppointment.topic.js +0 -6
- package/build/esm/__tests__/testDirsAndFiles/good/conversations/cancelAppointment.topic.d.ts +0 -3
- package/build/esm/__tests__/testDirsAndFiles/good/conversations/cancelAppointment.topic.js +0 -10
- package/build/esm/__tests__/testDirsAndFiles/skill/build/conversations/bookAppointment.topic.d.ts +0 -3
- package/build/esm/__tests__/testDirsAndFiles/skill/build/conversations/bookAppointment.topic.js +0 -6
- package/build/esm/__tests__/testDirsAndFiles/skill/build/conversations/cancelAppointment.topic.d.ts +0 -3
- package/build/esm/__tests__/testDirsAndFiles/skill/build/conversations/cancelAppointment.topic.js +0 -10
- package/build/esm/__tests__/testDirsAndFiles/skill/build/conversations/favoriteColor.topic.d.ts +0 -3
- package/build/esm/__tests__/testDirsAndFiles/skill/build/conversations/favoriteColor.topic.js +0 -28
- package/build/esm/__tests__/testDirsAndFiles/skill/build/conversations/favoriteColorTopicChanger.topic.d.ts +0 -3
- package/build/esm/__tests__/testDirsAndFiles/skill/build/conversations/favoriteColorTopicChanger.topic.js +0 -28
- package/build/esm/__tests__/testDirsAndFiles/skill/build/conversations/mixedStringsAndCallbacks.topic.d.ts +0 -3
- package/build/esm/__tests__/testDirsAndFiles/skill/build/conversations/mixedStringsAndCallbacks.topic.js +0 -36
- package/build/esm/__tests__/testDirsAndFiles/skill-assertions/build/conversations/assertsScriptCallbackOptions.topic.d.ts +0 -3
- package/build/esm/__tests__/testDirsAndFiles/skill-assertions/build/conversations/assertsScriptCallbackOptions.topic.js +0 -29
- package/build/esm/__tests__/testDirsAndFiles/skill-assertions/build/conversations/assertsScriptOnlyCalledOnce.topic.d.ts +0 -3
- package/build/esm/__tests__/testDirsAndFiles/skill-assertions/build/conversations/assertsScriptOnlyCalledOnce.topic.js +0 -21
- package/build/esm/__tests__/testDirsAndFiles/skill-with-one-topic/build/conversations/bookAppointment.topic.d.ts +0 -3
- package/build/esm/__tests__/testDirsAndFiles/skill-with-one-topic/build/conversations/bookAppointment.topic.js +0 -6
- package/build/esm/__tests__/testDirsAndFiles/skill-with-script-that-throws/build/conversations/cancelAppointment.topic.d.ts +0 -3
- package/build/esm/__tests__/testDirsAndFiles/skill-with-script-that-throws/build/conversations/cancelAppointment.topic.js +0 -14
|
@@ -1,477 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
import { test, assert, generateId } from '@sprucelabs/test-utils';
|
|
17
|
-
import { errorAssert } from '@sprucelabs/test-utils';
|
|
18
|
-
import AbstractConversationTest from '../../tests/AbstractConversationTest.js';
|
|
19
|
-
import { TopicScriptPlayer } from '../../topics/TopicScriptPlayer.js';
|
|
20
|
-
export default class TopicScriptPlayerTest extends AbstractConversationTest {
|
|
21
|
-
static throwsWhenRequiredOptionsNotSent() {
|
|
22
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
//@ts-ignore
|
|
24
|
-
const err = assert.doesThrow(() => new TopicScriptPlayer());
|
|
25
|
-
errorAssert.assertError(err, 'MISSING_PARAMETERS', {
|
|
26
|
-
parameters: [
|
|
27
|
-
'script',
|
|
28
|
-
'sendMessageHandler',
|
|
29
|
-
'target.personId',
|
|
30
|
-
'getContext',
|
|
31
|
-
],
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
static respondsToMessageWithOnlyLineInScript() {
|
|
36
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
const messages = [];
|
|
38
|
-
const player = this.Player({
|
|
39
|
-
script: ['It all started on a cold, dark night.'],
|
|
40
|
-
target: { personId: '12345' },
|
|
41
|
-
sendMessageHandler: (message) => __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
messages.push(message);
|
|
43
|
-
}),
|
|
44
|
-
});
|
|
45
|
-
yield this.sendMessage(player, {
|
|
46
|
-
body: 'how are you today?',
|
|
47
|
-
});
|
|
48
|
-
assert.isLength(messages, 1);
|
|
49
|
-
assert.isEqual(messages[0].body, 'It all started on a cold, dark night.');
|
|
50
|
-
assert.isEqualDeep(messages[0].target.personId, '12345');
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
static respondsToMessagesWithAllLinesInScript() {
|
|
54
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
const messages = [];
|
|
56
|
-
const player = this.Player({
|
|
57
|
-
script: [
|
|
58
|
-
'It all started on a cold, dark night.',
|
|
59
|
-
'Before the sun went down',
|
|
60
|
-
],
|
|
61
|
-
sendMessageHandler: (message) => __awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
messages.push(message);
|
|
63
|
-
}),
|
|
64
|
-
});
|
|
65
|
-
yield this.sendMessage(player, {
|
|
66
|
-
body: 'how are you today?',
|
|
67
|
-
});
|
|
68
|
-
assert.isLength(messages, 2);
|
|
69
|
-
assert.isEqual(messages[0].body, 'It all started on a cold, dark night.');
|
|
70
|
-
assert.isEqual(messages[1].body, 'Before the sun went down');
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
static multipleTextLinesWaitsForDelay() {
|
|
74
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
-
const messages = [];
|
|
76
|
-
const player = this.Player({
|
|
77
|
-
lineDelay: 50,
|
|
78
|
-
script: [
|
|
79
|
-
'It all started on a cold, dark night.',
|
|
80
|
-
'Before the sun went down',
|
|
81
|
-
],
|
|
82
|
-
sendMessageHandler: (message) => __awaiter(this, void 0, void 0, function* () {
|
|
83
|
-
messages.push(message);
|
|
84
|
-
}),
|
|
85
|
-
});
|
|
86
|
-
void this.sendMessage(player, {
|
|
87
|
-
body: 'how are you today?',
|
|
88
|
-
});
|
|
89
|
-
assert.isLength(messages, 1);
|
|
90
|
-
yield this.wait(100);
|
|
91
|
-
assert.isLength(messages, 2);
|
|
92
|
-
assert.isEqual(messages[0].body, 'It all started on a cold, dark night.');
|
|
93
|
-
assert.isEqual(messages[1].body, 'Before the sun went down');
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
static restartsScriptNextMessage() {
|
|
97
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
-
const messages = [];
|
|
99
|
-
const player = this.Player({
|
|
100
|
-
script: [
|
|
101
|
-
'It all started on a cold, dark night.',
|
|
102
|
-
'Before the sun went down',
|
|
103
|
-
],
|
|
104
|
-
sendMessageHandler: (message) => __awaiter(this, void 0, void 0, function* () {
|
|
105
|
-
messages.push(message);
|
|
106
|
-
}),
|
|
107
|
-
});
|
|
108
|
-
yield this.sendMessage(player, {
|
|
109
|
-
body: 'how are you today?',
|
|
110
|
-
});
|
|
111
|
-
yield this.sendMessage(player, {
|
|
112
|
-
body: 'how are you today?',
|
|
113
|
-
});
|
|
114
|
-
assert.isLength(messages, 4);
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
static respondsWithRandomLine() {
|
|
118
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
-
const messages = [];
|
|
120
|
-
const player = this.Player({
|
|
121
|
-
script: [['one', 'two', 'three']],
|
|
122
|
-
sendMessageHandler: (message) => __awaiter(this, void 0, void 0, function* () {
|
|
123
|
-
messages.push(message);
|
|
124
|
-
}),
|
|
125
|
-
});
|
|
126
|
-
const remaining = { one: 1, two: 1, three: 1 };
|
|
127
|
-
do {
|
|
128
|
-
yield this.sendMessage(player, {
|
|
129
|
-
body: 'how are you today?',
|
|
130
|
-
});
|
|
131
|
-
if (messages.length === 0) {
|
|
132
|
-
assert.fail("Didn't send any message.");
|
|
133
|
-
}
|
|
134
|
-
//@ts-ignore
|
|
135
|
-
delete remaining[messages.pop().body];
|
|
136
|
-
} while (Object.keys(remaining).length > 0);
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
static renderLineSendsMessage() {
|
|
140
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
141
|
-
const messages = [];
|
|
142
|
-
const player = this.Player({
|
|
143
|
-
script: [
|
|
144
|
-
(options) => __awaiter(this, void 0, void 0, function* () {
|
|
145
|
-
options.ui.renderLine('What is up?');
|
|
146
|
-
}),
|
|
147
|
-
],
|
|
148
|
-
sendMessageHandler: (message) => __awaiter(this, void 0, void 0, function* () {
|
|
149
|
-
messages.push(message);
|
|
150
|
-
}),
|
|
151
|
-
});
|
|
152
|
-
yield this.sendMessage(player, {
|
|
153
|
-
body: 'What the?',
|
|
154
|
-
});
|
|
155
|
-
assert.isLength(messages, 1);
|
|
156
|
-
assert.isEqual(messages[0].body, 'What is up?');
|
|
157
|
-
//@ts-ignore
|
|
158
|
-
assert.isFalsy(messages[0].target.isCore);
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
static scriptCanAskToConfirm(confirmBody, expectedConfirmResults) {
|
|
162
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
-
let confirmStarted = false;
|
|
164
|
-
let confirmResponse;
|
|
165
|
-
let confirmFinished = false;
|
|
166
|
-
const messages = [];
|
|
167
|
-
const player = this.Player({
|
|
168
|
-
sendMessageHandler: (message) => __awaiter(this, void 0, void 0, function* () {
|
|
169
|
-
messages.push(message);
|
|
170
|
-
}),
|
|
171
|
-
script: [
|
|
172
|
-
'It all started on a cold, dark night.',
|
|
173
|
-
'Before the sun went down',
|
|
174
|
-
(options) => __awaiter(this, void 0, void 0, function* () {
|
|
175
|
-
confirmStarted = true;
|
|
176
|
-
const confirm = yield options.ui.confirm('Are you sure?');
|
|
177
|
-
confirmResponse = confirm;
|
|
178
|
-
confirmFinished = true;
|
|
179
|
-
}),
|
|
180
|
-
],
|
|
181
|
-
});
|
|
182
|
-
void this.sendMessage(player, {
|
|
183
|
-
body: 'tell me a story!',
|
|
184
|
-
});
|
|
185
|
-
yield this.wait(100);
|
|
186
|
-
assert.isTrue(confirmStarted);
|
|
187
|
-
assert.isUndefined(confirmResponse);
|
|
188
|
-
assert.isFalse(confirmFinished);
|
|
189
|
-
yield this.sendMessage(player, {
|
|
190
|
-
body: confirmBody,
|
|
191
|
-
});
|
|
192
|
-
yield this.wait(100);
|
|
193
|
-
assert.isTrue(confirmStarted);
|
|
194
|
-
assert.isEqual(confirmResponse, expectedConfirmResults);
|
|
195
|
-
assert.isTrue(confirmFinished);
|
|
196
|
-
assert.doesInclude(messages, { body: 'Are you sure?' });
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
static scriptCanRespondWithTransition() {
|
|
200
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
201
|
-
const player = this.Player({
|
|
202
|
-
script: [
|
|
203
|
-
() => __awaiter(this, void 0, void 0, function* () {
|
|
204
|
-
return { transitionConversationTo: 'greeting' };
|
|
205
|
-
}),
|
|
206
|
-
],
|
|
207
|
-
});
|
|
208
|
-
const results = yield this.sendMessage(player, {
|
|
209
|
-
body: 'tell me a story!',
|
|
210
|
-
});
|
|
211
|
-
assert.isTruthy(results);
|
|
212
|
-
assert.isTruthy(results.transitionConversationTo);
|
|
213
|
-
assert.isEqual(results.transitionConversationTo, 'greeting');
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
static scriptCanRespondWithTransitionAInLaterLines() {
|
|
217
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
218
|
-
const player = this.Player({
|
|
219
|
-
script: [
|
|
220
|
-
'Hey there!',
|
|
221
|
-
() => __awaiter(this, void 0, void 0, function* () { }),
|
|
222
|
-
() => __awaiter(this, void 0, void 0, function* () {
|
|
223
|
-
return { transitionConversationTo: 'greeting' };
|
|
224
|
-
}),
|
|
225
|
-
],
|
|
226
|
-
});
|
|
227
|
-
const results = yield this.sendMessage(player, {
|
|
228
|
-
body: 'tell me a story!',
|
|
229
|
-
});
|
|
230
|
-
assert.isTruthy(results);
|
|
231
|
-
assert.isTruthy(results.transitionConversationTo);
|
|
232
|
-
assert.isEqual(results.transitionConversationTo, 'greeting');
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
static scriptCanRespondWithTransitionAInLaterLinesAfterAskingForInput() {
|
|
236
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
237
|
-
const player = this.Player({
|
|
238
|
-
script: [
|
|
239
|
-
'Hey there!',
|
|
240
|
-
(options) => __awaiter(this, void 0, void 0, function* () {
|
|
241
|
-
yield options.ui.prompt({ type: 'text', isRequired: true });
|
|
242
|
-
}),
|
|
243
|
-
() => __awaiter(this, void 0, void 0, function* () {
|
|
244
|
-
return { transitionConversationTo: 'greeting' };
|
|
245
|
-
}),
|
|
246
|
-
],
|
|
247
|
-
});
|
|
248
|
-
yield this.sendMessage(player, {
|
|
249
|
-
body: 'tell me a story!',
|
|
250
|
-
});
|
|
251
|
-
const results = yield this.sendMessage(player, {
|
|
252
|
-
body: 'Yes!',
|
|
253
|
-
});
|
|
254
|
-
assert.isTruthy(results);
|
|
255
|
-
assert.isTruthy(results.transitionConversationTo);
|
|
256
|
-
assert.isEqual(results.transitionConversationTo, 'greeting');
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
static randomOnOptions() {
|
|
260
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
261
|
-
const messages = [];
|
|
262
|
-
const remaining = { one: true, two: true, three: true };
|
|
263
|
-
const possibilities = [
|
|
264
|
-
'one',
|
|
265
|
-
'two',
|
|
266
|
-
'three',
|
|
267
|
-
];
|
|
268
|
-
const player = this.Player({
|
|
269
|
-
sendMessageHandler: (message) => __awaiter(this, void 0, void 0, function* () {
|
|
270
|
-
messages.push(message.body);
|
|
271
|
-
}),
|
|
272
|
-
script: [
|
|
273
|
-
(options) => __awaiter(this, void 0, void 0, function* () {
|
|
274
|
-
assert.isFunction(options.rand);
|
|
275
|
-
const answer = options.rand(possibilities);
|
|
276
|
-
//@ts-ignore
|
|
277
|
-
delete remaining[answer];
|
|
278
|
-
}),
|
|
279
|
-
],
|
|
280
|
-
});
|
|
281
|
-
do {
|
|
282
|
-
yield this.sendMessage(player, {
|
|
283
|
-
body: 'tell me a story!',
|
|
284
|
-
});
|
|
285
|
-
} while (Object.keys(remaining).length > 0);
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
static randomOptionsRandomOnNotString() {
|
|
289
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
290
|
-
const possibilities = [true, false];
|
|
291
|
-
let answer;
|
|
292
|
-
const player = this.Player({
|
|
293
|
-
script: [
|
|
294
|
-
(options) => __awaiter(this, void 0, void 0, function* () {
|
|
295
|
-
assert.isFunction(options.rand);
|
|
296
|
-
answer = options.rand(possibilities);
|
|
297
|
-
}),
|
|
298
|
-
],
|
|
299
|
-
});
|
|
300
|
-
yield this.sendMessage(player, {
|
|
301
|
-
body: 'go',
|
|
302
|
-
});
|
|
303
|
-
assert.isTrue(possibilities.includes(answer));
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
static retainsStateBetweenScriptLines() {
|
|
307
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
308
|
-
const player = this.Player({
|
|
309
|
-
script: [
|
|
310
|
-
(options) => __awaiter(this, void 0, void 0, function* () {
|
|
311
|
-
options.state.goTeam = true;
|
|
312
|
-
}),
|
|
313
|
-
(options) => __awaiter(this, void 0, void 0, function* () {
|
|
314
|
-
assert.isTrue(options.state.goTeam);
|
|
315
|
-
}),
|
|
316
|
-
],
|
|
317
|
-
});
|
|
318
|
-
yield this.sendMessage(player, {
|
|
319
|
-
body: 'tell me a story!',
|
|
320
|
-
});
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
static retainsStateBetweenMessages() {
|
|
324
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
325
|
-
let stateCount = 0;
|
|
326
|
-
const player = this.Player({
|
|
327
|
-
script: [
|
|
328
|
-
(options) => __awaiter(this, void 0, void 0, function* () {
|
|
329
|
-
if (!options.state.count) {
|
|
330
|
-
options.state.count = 1;
|
|
331
|
-
}
|
|
332
|
-
else {
|
|
333
|
-
options.state.count++;
|
|
334
|
-
}
|
|
335
|
-
}),
|
|
336
|
-
(options) => __awaiter(this, void 0, void 0, function* () {
|
|
337
|
-
options.state.count++;
|
|
338
|
-
stateCount = options.state.count;
|
|
339
|
-
}),
|
|
340
|
-
],
|
|
341
|
-
});
|
|
342
|
-
yield this.sendMessage(player, {
|
|
343
|
-
body: 'tell me a story!',
|
|
344
|
-
});
|
|
345
|
-
assert.isEqual(stateCount, 2);
|
|
346
|
-
yield this.sendMessage(player, { body: 'again, again!' });
|
|
347
|
-
assert.isEqual(stateCount, 4);
|
|
348
|
-
});
|
|
349
|
-
}
|
|
350
|
-
static alwaysEndsWithRedirectToDiscovery() {
|
|
351
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
352
|
-
let stateCount = 0;
|
|
353
|
-
const player = this.Player({
|
|
354
|
-
script: [
|
|
355
|
-
(options) => __awaiter(this, void 0, void 0, function* () {
|
|
356
|
-
if (!options.state.count) {
|
|
357
|
-
options.state.count = 1;
|
|
358
|
-
}
|
|
359
|
-
else {
|
|
360
|
-
options.state.count++;
|
|
361
|
-
}
|
|
362
|
-
}),
|
|
363
|
-
(options) => __awaiter(this, void 0, void 0, function* () {
|
|
364
|
-
options.state.count++;
|
|
365
|
-
stateCount = options.state.count;
|
|
366
|
-
}),
|
|
367
|
-
],
|
|
368
|
-
});
|
|
369
|
-
let results = yield this.sendMessage(player, {
|
|
370
|
-
body: 'tell me a story!',
|
|
371
|
-
});
|
|
372
|
-
assert.isEqual(results === null || results === void 0 ? void 0 : results.transitionConversationTo, 'discovery');
|
|
373
|
-
assert.isEqual(stateCount, 2);
|
|
374
|
-
results = yield this.sendMessage(player, { body: 'again, again!' });
|
|
375
|
-
assert.isEqual(results === null || results === void 0 ? void 0 : results.transitionConversationTo, 'discovery');
|
|
376
|
-
assert.isEqual(stateCount, 4);
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
static skillContextAvailableOnScriptLine(context) {
|
|
380
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
381
|
-
let passedContext;
|
|
382
|
-
const player = this.Player({
|
|
383
|
-
getContext: () => context,
|
|
384
|
-
script: [
|
|
385
|
-
(options) => __awaiter(this, void 0, void 0, function* () {
|
|
386
|
-
passedContext = options.context;
|
|
387
|
-
}),
|
|
388
|
-
],
|
|
389
|
-
});
|
|
390
|
-
yield this.sendMessage(player, {
|
|
391
|
-
body: generateId(),
|
|
392
|
-
});
|
|
393
|
-
assert.isEqualDeep(passedContext, context);
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
|
-
static Player(options) {
|
|
397
|
-
var _a, _b;
|
|
398
|
-
return new TopicScriptPlayer(Object.assign({ target: (_a = options.target) !== null && _a !== void 0 ? _a : { personId: '12345' }, lineDelay: 0, sendMessageHandler: (_b = options.sendMessageHandler) !== null && _b !== void 0 ? _b : function () {
|
|
399
|
-
return __awaiter(this, void 0, void 0, function* () { });
|
|
400
|
-
}, getContext: () => ({}) }, options));
|
|
401
|
-
}
|
|
402
|
-
static sendMessage(player, message) {
|
|
403
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
404
|
-
return player.handleMessage(this.buildMessage(Object.assign({ source: { personId: '1234' } }, message)));
|
|
405
|
-
});
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
__decorate([
|
|
409
|
-
test()
|
|
410
|
-
], TopicScriptPlayerTest, "throwsWhenRequiredOptionsNotSent", null);
|
|
411
|
-
__decorate([
|
|
412
|
-
test()
|
|
413
|
-
], TopicScriptPlayerTest, "respondsToMessageWithOnlyLineInScript", null);
|
|
414
|
-
__decorate([
|
|
415
|
-
test()
|
|
416
|
-
], TopicScriptPlayerTest, "respondsToMessagesWithAllLinesInScript", null);
|
|
417
|
-
__decorate([
|
|
418
|
-
test()
|
|
419
|
-
], TopicScriptPlayerTest, "multipleTextLinesWaitsForDelay", null);
|
|
420
|
-
__decorate([
|
|
421
|
-
test()
|
|
422
|
-
], TopicScriptPlayerTest, "restartsScriptNextMessage", null);
|
|
423
|
-
__decorate([
|
|
424
|
-
test()
|
|
425
|
-
], TopicScriptPlayerTest, "respondsWithRandomLine", null);
|
|
426
|
-
__decorate([
|
|
427
|
-
test()
|
|
428
|
-
], TopicScriptPlayerTest, "renderLineSendsMessage", null);
|
|
429
|
-
__decorate([
|
|
430
|
-
test('Passes confirm when sent "Y"', 'Y', true),
|
|
431
|
-
test('Passes confirm when sent "y"', 'y', true),
|
|
432
|
-
test('Passes confirm when sent "yes"', 'yes', true),
|
|
433
|
-
test('Passes confirm when sent "yup"', 'yup', true),
|
|
434
|
-
test('Passes confirm when sent "yes please"', 'yes please', true),
|
|
435
|
-
test('Passes confirm when sent "yeah"', 'yeah', true),
|
|
436
|
-
test('Passes confirm when sent "yeah!!!"', 'yeah!!!', true),
|
|
437
|
-
test('Passes confirm when sent "oh heck ya"', 'oh heck ya', true),
|
|
438
|
-
test('Passes confirm when sent "oh heck yeah"', 'oh heck yeah', true),
|
|
439
|
-
test('Passes confirm when sent "👍"', '👍', true),
|
|
440
|
-
test('Fails confirm when sent "negative"', 'negative', false),
|
|
441
|
-
test('Fails confirm when sent "nope"', 'nope', false),
|
|
442
|
-
test('Fails confirm when sent "nope!!"', 'nope!!', false),
|
|
443
|
-
test('Fails confirm when sent "no"', 'no', false),
|
|
444
|
-
test('Fails confirm when sent "no thanks"', 'no thanks', false),
|
|
445
|
-
test('Fails confirm when sent "no thank you"', 'no thank you', false),
|
|
446
|
-
test('Fails confirm when sent "nah"', 'nah', false),
|
|
447
|
-
test('Fails confirm when sent "No thanks!!!"', 'No thanks!!!', false),
|
|
448
|
-
test('Fails confirm when sent "👎"', '👎', true)
|
|
449
|
-
], TopicScriptPlayerTest, "scriptCanAskToConfirm", null);
|
|
450
|
-
__decorate([
|
|
451
|
-
test()
|
|
452
|
-
], TopicScriptPlayerTest, "scriptCanRespondWithTransition", null);
|
|
453
|
-
__decorate([
|
|
454
|
-
test()
|
|
455
|
-
], TopicScriptPlayerTest, "scriptCanRespondWithTransitionAInLaterLines", null);
|
|
456
|
-
__decorate([
|
|
457
|
-
test()
|
|
458
|
-
], TopicScriptPlayerTest, "scriptCanRespondWithTransitionAInLaterLinesAfterAskingForInput", null);
|
|
459
|
-
__decorate([
|
|
460
|
-
test()
|
|
461
|
-
], TopicScriptPlayerTest, "randomOnOptions", null);
|
|
462
|
-
__decorate([
|
|
463
|
-
test()
|
|
464
|
-
], TopicScriptPlayerTest, "randomOptionsRandomOnNotString", null);
|
|
465
|
-
__decorate([
|
|
466
|
-
test()
|
|
467
|
-
], TopicScriptPlayerTest, "retainsStateBetweenScriptLines", null);
|
|
468
|
-
__decorate([
|
|
469
|
-
test()
|
|
470
|
-
], TopicScriptPlayerTest, "retainsStateBetweenMessages", null);
|
|
471
|
-
__decorate([
|
|
472
|
-
test()
|
|
473
|
-
], TopicScriptPlayerTest, "alwaysEndsWithRedirectToDiscovery", null);
|
|
474
|
-
__decorate([
|
|
475
|
-
test('can passe context 1', { skill: 'test' }),
|
|
476
|
-
test('can passe context 2', { hello: 'world' })
|
|
477
|
-
], TopicScriptPlayerTest, "skillContextAvailableOnScriptLine", null);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import AbstractSpruceTest from '@sprucelabs/test-utils';
|
|
2
|
-
export default class TopicSuggesterTest extends AbstractSpruceTest {
|
|
3
|
-
protected static canCreateTopicSuggester(): Promise<void>;
|
|
4
|
-
protected static canReturnOnlyTopic(): Promise<void>;
|
|
5
|
-
protected static makeSureTopicsAreReturnedInOrderOfConfidence(): Promise<void>;
|
|
6
|
-
protected static matchTests(phrase: string, expectedSuggestionKey: string): Promise<void>;
|
|
7
|
-
private static Suggester;
|
|
8
|
-
}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
import AbstractSpruceTest, { test, assert } from '@sprucelabs/test-utils';
|
|
17
|
-
import { TopicSuggester } from '../../topics/TopicSuggester.js';
|
|
18
|
-
export default class TopicSuggesterTest extends AbstractSpruceTest {
|
|
19
|
-
static canCreateTopicSuggester() {
|
|
20
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
const topicSuggester = yield TopicSuggester.Suggester({ topics: [] });
|
|
22
|
-
assert.isTruthy(topicSuggester);
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
static canReturnOnlyTopic() {
|
|
26
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
const topics = [
|
|
28
|
-
{
|
|
29
|
-
key: 'bookAppointment',
|
|
30
|
-
label: 'Book an appointment',
|
|
31
|
-
utterances: ['book an appointment'],
|
|
32
|
-
},
|
|
33
|
-
];
|
|
34
|
-
const messageBody = 'book';
|
|
35
|
-
const suggestions = yield this.Suggester(topics, messageBody);
|
|
36
|
-
assert.doesInclude(suggestions[0], {
|
|
37
|
-
key: 'bookAppointment',
|
|
38
|
-
label: 'Book an appointment',
|
|
39
|
-
});
|
|
40
|
-
assert.isAbove(suggestions[0].confidence, 0);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
static makeSureTopicsAreReturnedInOrderOfConfidence() {
|
|
44
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
const suggestions = yield this.Suggester([
|
|
46
|
-
{
|
|
47
|
-
key: 'scheduleShft',
|
|
48
|
-
label: 'Shift',
|
|
49
|
-
utterances: [
|
|
50
|
-
'shift',
|
|
51
|
-
'block my time',
|
|
52
|
-
'break',
|
|
53
|
-
'hours',
|
|
54
|
-
'schedule',
|
|
55
|
-
],
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
key: 'bookAppointment',
|
|
59
|
-
label: 'Book',
|
|
60
|
-
utterances: [
|
|
61
|
-
'book appointment',
|
|
62
|
-
'schedule an appointment',
|
|
63
|
-
'book',
|
|
64
|
-
'schedule',
|
|
65
|
-
],
|
|
66
|
-
},
|
|
67
|
-
], "I'd like to schedule a haircut");
|
|
68
|
-
assert.isLength(suggestions, 2);
|
|
69
|
-
assert.isEqualDeep(suggestions[0].key, 'bookAppointment');
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
static matchTests(phrase, expectedSuggestionKey) {
|
|
73
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
-
const suggestions = yield this.Suggester([
|
|
75
|
-
{
|
|
76
|
-
key: 'contactUs',
|
|
77
|
-
label: 'Contact',
|
|
78
|
-
utterances: [
|
|
79
|
-
'tell me more',
|
|
80
|
-
'experience',
|
|
81
|
-
'experience management',
|
|
82
|
-
'tell me about experience',
|
|
83
|
-
'I want to know more',
|
|
84
|
-
],
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
key: 'jokes',
|
|
88
|
-
label: 'Jokes',
|
|
89
|
-
utterances: [
|
|
90
|
-
'be funny',
|
|
91
|
-
'tell me a joke',
|
|
92
|
-
'tell me something funny',
|
|
93
|
-
'laugh',
|
|
94
|
-
'funny',
|
|
95
|
-
'make me laugh',
|
|
96
|
-
'robot jokes',
|
|
97
|
-
],
|
|
98
|
-
},
|
|
99
|
-
], phrase);
|
|
100
|
-
assert.isLength(suggestions, 2);
|
|
101
|
-
assert.isEqualDeep(suggestions[0].key, expectedSuggestionKey);
|
|
102
|
-
assert.isAbove(suggestions[0].confidence, 0.8);
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
static Suggester(topics, messageBody) {
|
|
106
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
107
|
-
const topicSuggester = yield TopicSuggester.Suggester({
|
|
108
|
-
topics,
|
|
109
|
-
});
|
|
110
|
-
const suggestions = yield topicSuggester.suggest(messageBody);
|
|
111
|
-
return suggestions;
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
__decorate([
|
|
116
|
-
test()
|
|
117
|
-
], TopicSuggesterTest, "canCreateTopicSuggester", null);
|
|
118
|
-
__decorate([
|
|
119
|
-
test()
|
|
120
|
-
], TopicSuggesterTest, "canReturnOnlyTopic", null);
|
|
121
|
-
__decorate([
|
|
122
|
-
test()
|
|
123
|
-
], TopicSuggesterTest, "makeSureTopicsAreReturnedInOrderOfConfidence", null);
|
|
124
|
-
__decorate([
|
|
125
|
-
test('matches regardless "Experience "', 'Experience ', 'contactUs'),
|
|
126
|
-
test('matches regardless "Tell me about experience"', 'Tell me about experience ', 'contactUs'),
|
|
127
|
-
test('matches "Tell me something funny"', 'Tell me something funny', 'jokes'),
|
|
128
|
-
test('matches "Joke me"', 'Joke me', 'jokes'),
|
|
129
|
-
test('matches "Joke me"', 'Joke me', 'jokes')
|
|
130
|
-
], TopicSuggesterTest, "matchTests", null);
|
package/build/esm/__tests__/testDirsAndFiles/bad-empty/conversations/bookAppointment.topic.d.ts
DELETED
|
File without changes
|
package/build/esm/__tests__/testDirsAndFiles/bad-empty/conversations/bookAppointment.topic.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|