• 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 { CounterSummary, SdkSliceSummary } from '../../../dist/trace/bean/SdkSummary.js';
18
19describe('SdkSummary Test', () => {
20  it('SdkSummaryTest01', function () {
21    let counterSummary = new CounterSummary();
22    counterSummary = {
23      value: 0,
24      ts: 0,
25      counter_id: 0,
26    };
27    expect(counterSummary).not.toBeUndefined();
28    expect(counterSummary).toMatchInlineSnapshot(
29{
30  value: expect.any(Number),
31  ts: expect.any(Number),
32  counter_id: expect.any(Number) }, `
33{
34  "counter_id": Any<Number>,
35  "ts": Any<Number>,
36  "value": Any<Number>,
37}
38`);
39  });
40
41  it('SdkSliceSummaryTest02', function () {
42    let sdkSliceSummary = new SdkSliceSummary();
43    sdkSliceSummary = {
44      start_ts: 0,
45      end_ts: 0,
46      value: 0,
47      column_id: 0,
48      slice_message: 'slice_message',
49    };
50    expect(sdkSliceSummary).not.toBeUndefined();
51    expect(sdkSliceSummary).toMatchInlineSnapshot(
52{
53  start_ts: expect.any(Number),
54  end_ts: expect.any(Number),
55  value: expect.any(Number),
56  column_id: expect.any(Number),
57  slice_message: expect.any(String) }, `
58{
59  "column_id": Any<Number>,
60  "end_ts": Any<Number>,
61  "slice_message": Any<String>,
62  "start_ts": Any<Number>,
63  "value": Any<Number>,
64}
65`);
66  });
67});
68