Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.

Commit 4eea4a6

Browse files
Batta32darrenj
authored andcommitted
[BotBuilder Libs][TypeScript] Implement test main structure (#1377)
* Implement mocha * Implement main test structure * Implement nyc code coverage * Implement mocha and nyc * Add test main structure * Implement test report * Update command-line.json file * Update shrinkwrap.json file * Update package.json in skills and solutions libs
1 parent cef00f2 commit 4eea4a6

21 files changed

+1524
-79
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"extension": [
3+
".ts"
4+
],
5+
"exclude": [
6+
"node_modules/**",
7+
"test/**",
8+
"coverage/**",
9+
"**/*.d.ts"
10+
],
11+
"reporter": [
12+
"cobertura",
13+
"html",
14+
"text"
15+
],
16+
"all": true,
17+
"cache": true
18+
}

lib/typescript/botbuilder-skills/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"prebuild": "npm run lint",
1313
"build": "tsc --p tsconfig.json && npm run copy-templates",
1414
"lint": "tslint -t vso ./src/**/*.ts",
15-
"test": "mocha ./test/"
15+
"test": "mocha test/",
16+
"coverage": "nyc mocha test/"
1617
},
1718
"dependencies": {
1819
"@azure/ms-rest-js": "1.2.6",
@@ -42,6 +43,8 @@
4243
"@types/uuid": "^3.4.4",
4344
"copyfiles": "^2.1.0",
4445
"mocha": "^6.1.4",
46+
"mocha-junit-reporter": "^1.22.0",
47+
"nyc": "^14.1.1",
4548
"replace": "^1.0.0",
4649
"rimraf": "^2.6.2",
4750
"tslint": "^5.12.1",

lib/typescript/botbuilder-skills/test/flow/manifestTest.js

Whitespace-only changes.

lib/typescript/botbuilder-skills/test/flow/skillDialogInvocationTest.js

Whitespace-only changes.

lib/typescript/botbuilder-skills/test/flow/skillDialogSlotFillingTest.js

Whitespace-only changes.

lib/typescript/botbuilder-skills/test/flow/skillDialogTest.js

Whitespace-only changes.

lib/typescript/botbuilder-skills/test/flow/skillDialogTestBase.js

Whitespace-only changes.

lib/typescript/botbuilder-skills/test/flow/skillMiddlewareTest.js

Whitespace-only changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
--reporter mocha-junit-reporter
2+
--timeout 50000
3+
--recursive
4+
--colors
5+
**/*Test.js
Lines changed: 309 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,309 @@
1+
{
2+
"id": "calendarSkill",
3+
"name": "Calendar Skill",
4+
"description": "The Calendar skill provides calendaring related capabilities and supports Office and Google calendars.",
5+
"iconUrl": "calendarSkill.png",
6+
"authenticationConnections": [
7+
{
8+
"id": "Outlook",
9+
"serviceProviderId": "Azure Active Directory v2",
10+
"scopes": "User.Read, User.ReadBasic.All, Calendars.ReadWrite, People.Read"
11+
},
12+
{
13+
"id": "Google",
14+
"serviceProviderId": "Google",
15+
"scopes": "https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/contacts"
16+
}
17+
],
18+
"actions": [
19+
{
20+
"id": "calendarSkill/createEvent",
21+
"definition": {
22+
"description": "Create a new event",
23+
"slots": [
24+
{
25+
"name": "title",
26+
"types": [ "string" ]
27+
},
28+
{
29+
"name": "content",
30+
"types": [ "string" ]
31+
},
32+
{
33+
"name": "attendees",
34+
"types": [ "string" ]
35+
},
36+
{
37+
"name": "startDate",
38+
"types": [ "string" ]
39+
},
40+
{
41+
"name": "startTime",
42+
"types": [ "string" ]
43+
},
44+
{
45+
"name": "duration",
46+
"types": [ "string" ]
47+
},
48+
{
49+
"name": "location",
50+
"types": [ "string" ]
51+
}
52+
],
53+
"triggers": {
54+
"utteranceSources": [
55+
{
56+
"locale": "en",
57+
"source": [
58+
"Calendar#CreateCalendarEntry",
59+
"Calendar#FindMeetingRoom"
60+
]
61+
},
62+
{
63+
"locale": "de",
64+
"source": [
65+
"Calendar#CreateCalendarEntry",
66+
"Calendar#FindMeetingRoom"
67+
]
68+
},
69+
{
70+
"locale": "fr",
71+
"source": [
72+
"Calendar#CreateCalendarEntry",
73+
"Calendar#FindMeetingRoom"
74+
]
75+
}
76+
]
77+
}
78+
}
79+
},
80+
{
81+
"id": "calendarSkill/changeEventStatus",
82+
"definition": {
83+
"description": "Change the status of an event (accept/decline).",
84+
"slots": [
85+
{
86+
"name": "startDate",
87+
"types": [ "string" ]
88+
},
89+
{
90+
"name": "startTime",
91+
"types": [ "string" ]
92+
}
93+
],
94+
"triggers": {
95+
"utteranceSources": [
96+
{
97+
"locale": "en",
98+
"source": [
99+
"Calendar#AcceptEventEntry",
100+
"Calendar#DeleteCalendarEntry"
101+
]
102+
},
103+
{
104+
"locale": "de",
105+
"source": [
106+
"Calendar#AcceptEventEntry",
107+
"Calendar#DeleteCalendarEntry"
108+
]
109+
},
110+
{
111+
"locale": "fr",
112+
"source": [
113+
"Calendar#AcceptEventEntry",
114+
"Calendar#DeleteCalendarEntry"
115+
]
116+
}
117+
]
118+
}
119+
}
120+
},
121+
{
122+
"id": "calendarSkill/joinEvent",
123+
"definition": {
124+
"description": "Join the upcoming meeting",
125+
"slots": [],
126+
"triggers": {
127+
"utteranceSources": [
128+
{
129+
"locale": "en",
130+
"source": [
131+
"Calendar#ConnectToMeeting"
132+
]
133+
},
134+
{
135+
"locale": "de",
136+
"source": [
137+
"Calendar#ConnectToMeeting"
138+
]
139+
},
140+
{
141+
"locale": "fr",
142+
"source": [
143+
"Calendar#ConnectToMeeting"
144+
]
145+
}
146+
]
147+
}
148+
}
149+
},
150+
{
151+
"id": "https://calendarskill.microsoft.com/summary",
152+
"definition": {
153+
"description": "Retrieve a summary of meetings through an event invocation.",
154+
"slots": [],
155+
"triggers": {
156+
"events": [
157+
{
158+
"Name": "summaryEvent"
159+
}
160+
]
161+
}
162+
}
163+
},
164+
{
165+
"id": "calendarSkill/timeRemaining",
166+
"definition": {
167+
"description": "Find out how long until the next event",
168+
"slots": [],
169+
"triggers": {
170+
"utteranceSources": [
171+
{
172+
"locale": "en",
173+
"source": [
174+
"Calendar#TimeRemaining"
175+
]
176+
},
177+
{
178+
"locale": "de",
179+
"source": [
180+
"Calendar#TimeRemaining"
181+
]
182+
},
183+
{
184+
"locale": "fr",
185+
"source": [
186+
"Calendar#TimeRemaining"
187+
]
188+
}
189+
]
190+
}
191+
}
192+
},
193+
{
194+
"id": "calendarSkill/summary",
195+
"definition": {
196+
"description": "Find an upcoming event",
197+
"slots": [
198+
{
199+
"name": "startDate",
200+
"types": [ "string" ]
201+
},
202+
{
203+
"name": "startTime",
204+
"types": [ "string" ]
205+
},
206+
{
207+
"name": "endDate",
208+
"types": [ "string" ]
209+
},
210+
{
211+
"name": "endTime",
212+
"types": [ "string" ]
213+
}
214+
],
215+
"triggers": {
216+
"utteranceSources": [
217+
{
218+
"locale": "en",
219+
"source": [
220+
"Calendar#FindCalendarDetail",
221+
"Calendar#FindCalendarEntry",
222+
"Calendar#FindCalendarWhen",
223+
"Calendar#FindCalendarWhere",
224+
"Calendar#FindCalendarWho",
225+
"Calendar#FindDuration"
226+
]
227+
},
228+
{
229+
"locale": "de",
230+
"source": [
231+
"Calendar#FindCalendarDetail",
232+
"Calendar#FindCalendarEntry",
233+
"Calendar#FindCalendarWhen",
234+
"Calendar#FindCalendarWhere",
235+
"Calendar#FindCalendarWho",
236+
"Calendar#FindDuration"
237+
]
238+
},
239+
{
240+
"locale": "fr",
241+
"source": [
242+
"Calendar#FindCalendarDetail",
243+
"Calendar#FindCalendarEntry",
244+
"Calendar#FindCalendarWhen",
245+
"Calendar#FindCalendarWhere",
246+
"Calendar#FindCalendarWho",
247+
"Calendar#FindDuration"
248+
]
249+
}
250+
]
251+
}
252+
}
253+
},
254+
{
255+
"id": "calendarSkill/updateEvent",
256+
"definition": {
257+
"description": "Update an existing event.",
258+
"slots": [
259+
{
260+
"name": "startDate",
261+
"types": [ "string" ]
262+
},
263+
{
264+
"name": "startTime",
265+
"types": [ "string" ]
266+
},
267+
{
268+
"name": "endDate",
269+
"types": [ "string" ]
270+
},
271+
{
272+
"name": "endTime",
273+
"types": [ "string" ]
274+
},
275+
{
276+
"name": "newStartDate",
277+
"types": [ "string" ]
278+
},
279+
{
280+
"name": "newStartTime",
281+
"types": [ "string" ]
282+
}
283+
],
284+
"triggers": {
285+
"utteranceSources": [
286+
{
287+
"locale": "en",
288+
"source": [
289+
"Calendar#ChangeCalendarEntry"
290+
]
291+
},
292+
{
293+
"locale": "de",
294+
"source": [
295+
"Calendar#ChangeCalendarEntry"
296+
]
297+
},
298+
{
299+
"locale": "fr",
300+
"source": [
301+
"Calendar#ChangeCalendarEntry"
302+
]
303+
}
304+
]
305+
}
306+
}
307+
}
308+
]
309+
}

0 commit comments

Comments
 (0)