This repository has been archived by the owner on Jun 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Botskills] Implement tests for connect functionality (#1488)
* Refactor connectSkill functionality to export Class instead of functions * Continue implementing connect tests * Add tests for connectSkill functionality, update validations, remove 'process.exit(1)' * Refactor authenticationUtils to export class instead of function for ease to mock it * Add more tests for connect command * Add reporters for publishing test and coverage results
- Loading branch information
Showing
24 changed files
with
903 additions
and
425 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,8 @@ | |
], | ||
"reporter": [ | ||
"html", | ||
"text" | ||
"text", | ||
"cobertura" | ||
], | ||
"sourceMap": true, | ||
"cache": true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
414 changes: 214 additions & 200 deletions
414
lib/typescript/botskills/src/functionality/connectSkill.ts
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
418 changes: 212 additions & 206 deletions
418
lib/typescript/botskills/src/utils/authenticationUtils.ts
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
--reporter mocha-junit-reporter | ||
--timeout 50000 | ||
--colors | ||
--recursive | ||
|
27 changes: 27 additions & 0 deletions
27
lib/typescript/botskills/test/mockedFiles/connectableSkill.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"id": "connectableSkill", | ||
"msaAppId": "00000000-0000-0000-0000-000000000000", | ||
"name": "Test Skill", | ||
"endpoint": "https://bftestskill.azurewebsites.net/api/skill/messages", | ||
"description": "This is a test skill to use for testing purpose.", | ||
"authenticationConnections": [], | ||
"actions": [ | ||
{ | ||
"id": "connectableSkill_testAction", | ||
"definition": { | ||
"description": "Test Action", | ||
"slots": [], | ||
"triggers": { | ||
"utteranceSources": [ | ||
{ | ||
"locale": "en", | ||
"source": [ | ||
"connectableSkill#Test" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"msaAppId": "00000000-0000-0000-0000-000000000000", | ||
"description": "This is a test skill to use for testing purpose." | ||
} |
27 changes: 27 additions & 0 deletions
27
lib/typescript/botskills/test/mockedFiles/invalidSkillid.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"id": "test-./Skill", | ||
"msaAppId": "00000000-0000-0000-0000-000000000000", | ||
"name": "Test Skill", | ||
"endpoint": "https://bftestskill.azurewebsites.net/api/skill/messages", | ||
"description": "This is a test skill to use for testing purpose.", | ||
"authenticationConnections": [], | ||
"actions": [ | ||
{ | ||
"id": "testSkill_testAction", | ||
"definition": { | ||
"description": "Test Action", | ||
"slots": [], | ||
"triggers": { | ||
"utteranceSources": [ | ||
{ | ||
"locale": "en", | ||
"source": [ | ||
"test#Test" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} |
1 change: 1 addition & 0 deletions
1
lib/typescript/botskills/test/mockedFiles/luFolder/connectableSkill.lu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This is a mocked .lu file |
1 change: 1 addition & 0 deletions
1
lib/typescript/botskills/test/mockedFiles/luisFolder/connectableSkill.lu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This is a mocked .lu file |
1 change: 1 addition & 0 deletions
1
lib/typescript/botskills/test/mockedFiles/luisFolder/connectableSkill.luis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This is a mocked .luis file |
Empty file.
Empty file.
1 change: 1 addition & 0 deletions
1
lib/typescript/botskills/test/mockedFiles/successfulConnectFiles/connectableSkill.lu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This is a mocked .lu file |
1 change: 1 addition & 0 deletions
1
lib/typescript/botskills/test/mockedFiles/successfulConnectFiles/connectableSkill.luis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This is a mocked .luis file |
10 changes: 10 additions & 0 deletions
10
lib/typescript/botskills/test/mockedFiles/successfulConnectFiles/filledSkillsArray.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"skills": [ | ||
{ | ||
"id": "testSkill" | ||
}, | ||
{ | ||
"id": "testDispatch" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"id": "testSkill", | ||
"msaAppId": "00000000-0000-0000-0000-000000000000", | ||
"name": "Test Skill", | ||
"endpoint": "https://bftestskill.azurewebsites.net/api/skill/messages", | ||
"description": "This is a test skill to use for testing purpose.", | ||
"authenticationConnections": [], | ||
"actions": [ | ||
{ | ||
"id": "testSkill_testAction", | ||
"definition": { | ||
"description": "Test Action", | ||
"slots": [], | ||
"triggers": { | ||
"utteranceSources": [ | ||
{ | ||
"locale": "en", | ||
"source": [ | ||
"test#Test" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters