1 |
|
2 | ;
|
3 | var __importDefault = (this && this.__importDefault) || function (mod) {
|
4 | return (mod && mod.__esModule) ? mod : { "default": mod };
|
5 | };
|
6 | Object.defineProperty(exports, "__esModule", { value: true });
|
7 | /**
|
8 | * Wechaty Chatbot SDK - https://github.com/wechaty/wechaty
|
9 | *
|
10 | * @copyright 2016 Huan LI (李卓桓) <https://github.com/huan>, and
|
11 | * Wechaty Contributors <https://github.com/wechaty>.
|
12 | *
|
13 | * Licensed under the Apache License, Version 2.0 (the "License");
|
14 | * you may not use this file except in compliance with the License.
|
15 | * You may obtain a copy of the License at
|
16 | *
|
17 | * http://www.apache.org/licenses/LICENSE-2.0
|
18 | *
|
19 | * Unless required by applicable law or agreed to in writing, software
|
20 | * distributed under the License is distributed on an "AS IS" BASIS,
|
21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
22 | * See the License for the specific language governing permissions and
|
23 | * limitations under the License.
|
24 | *
|
25 | */
|
26 | const blue_tape_1 = __importDefault(require("blue-tape"));
|
27 | const puppet_manager_1 = require("./puppet-manager");
|
28 | blue_tape_1.default('resolve an unsupported puppet name', async (t) => {
|
29 | // try {
|
30 | // await PuppetManager.resolve('fasdfsfasfsfdfs')
|
31 | // t.fail('should reject')
|
32 | // } catch (e) {
|
33 | // t.pass('reject when options is a string: ' + e)
|
34 | // }
|
35 | try {
|
36 | await puppet_manager_1.PuppetManager.resolve({ puppet: 'fadfdsafa' });
|
37 | t.fail('should reject');
|
38 | }
|
39 | catch (e) {
|
40 | t.pass('reject when options.puppet is unknown: ' + e);
|
41 | }
|
42 | try {
|
43 | await puppet_manager_1.PuppetManager.resolve({ puppet: 'wechaty-puppet-mock' });
|
44 | t.pass('should allow "wechaty-puppet-mock" as puppet name');
|
45 | }
|
46 | catch (e) {
|
47 | t.fail('should pass "mock" as puppet name');
|
48 | }
|
49 | });
|
50 | //# sourceMappingURL=puppet-manager.spec.js.map |
\ | No newline at end of file |