• 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 { ProfilerClient } from '../../../dist/trace/grpc/ProfilerClient.js';
18
19describe('HiProfilerClient Test', () => {
20  it('HiProfilerClientTest01 ', function () {
21    expect(ProfilerClient.client).toBeUndefined();
22  });
23  it('HiProfilerClientTest02', function () {
24    ProfilerClient.client = true;
25    expect(ProfilerClient.client).toBeTruthy();
26  });
27  it('HiProfilerClientTest03 ', function () {
28    expect(ProfilerClient.filePaths).toBeUndefined();
29  });
30  it('HiProfilerClientTest04', function () {
31    ProfilerClient.filePaths = true;
32    expect(ProfilerClient.filePaths).toBeTruthy();
33  });
34  it('HiProfilerClientTest05', function () {
35    expect(ProfilerClient.profiler_proto).toBeUndefined();
36  });
37  it('HiProfilerClientTest06', function () {
38    ProfilerClient.profiler_proto = true;
39    expect(ProfilerClient.profiler_proto).toBeTruthy();
40  });
41
42  it('HiProfilerClientTest07 ', function () {
43    expect(ProfilerClient.shutdown).toBeUndefined();
44  });
45  it('HiProfilerClientTest08', function () {
46    ProfilerClient.getChannel = jest.fn(() => true);
47    expect(ProfilerClient.getChannel()).toBeTruthy();
48  });
49});
50