UNPKG

1.74 kBJavaScriptView Raw
1#!/usr/bin/env ts-node
2"use strict";
3var __importDefault = (this && this.__importDefault) || function (mod) {
4 return (mod && mod.__esModule) ? mod : { "default": mod };
5};
6Object.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 */
26const blue_tape_1 = __importDefault(require("blue-tape"));
27const io_1 = require("./io");
28const wechaty_1 = require("./wechaty");
29blue_tape_1.default('Io restart without problem', async (t) => {
30 const io = new io_1.Io({
31 // token must not contain any white spaces
32 servicePort: 8788,
33 token: 'mock_token_in_wechaty/wechaty/src/io.spec.ts',
34 wechaty: new wechaty_1.Wechaty(),
35 });
36 try {
37 for (let i = 0; i < 2; i++) {
38 await io.start();
39 await io.stop();
40 t.pass('start/stop-ed at #' + i);
41 }
42 t.pass('start/restart successed.');
43 }
44 catch (e) {
45 t.fail(e);
46 }
47});
48//# sourceMappingURL=io.spec.js.map
\No newline at end of file