• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16// @ts-ignore
17import { HdcClient } from '../../../dist/hdc/hdcclient/HdcClient.js';
18
19describe('HdcClient Test', () => {
20  it('HdcClientTest01', function () {
21    let hdcClient = new HdcClient();
22    expect(hdcClient.constructor()).toBeUndefined();
23  });
24  it('HdcClientTest02', function () {
25    let hdcClient = new HdcClient();
26    expect(hdcClient.bindStream()).toBeUndefined();
27  });
28  it('HdcClientTest03', function () {
29    let hdcClient = new HdcClient();
30    expect(hdcClient.bindStopStream()).toBeUndefined();
31  });
32  it('HdcClientTest04', function () {
33    let hdcClient = new HdcClient();
34    expect(hdcClient.unbindStream()).toBeTruthy();
35  });
36  it('HdcClientTest05', function () {
37    let hdcClient = new HdcClient();
38    expect(hdcClient.unbindStopStream()).toBeTruthy();
39  });
40
41  it('HdcClientTest06', async () => {
42    let hdcClient = new HdcClient();
43    await expect(hdcClient.connectDevice()).rejects.not.toBeUndefined();
44  });
45
46  it('HdcClientTest07', async () => {
47    let hdcClient = new HdcClient();
48    await expect(hdcClient.disconnect()).not;
49  });
50  it('HdcClientTest08', function () {
51    let hdcClient = new HdcClient();
52    let data = {
53      getChannelId: jest.fn(() => -1),
54    };
55    expect(hdcClient.createDataMessage(data)).toBeUndefined();
56  });
57});
58