• 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
21    it('SdkSummaryTest01', function () {
22        let counterSummary = new CounterSummary();
23        counterSummary = {
24            value:0,
25            ts: 0,
26            counter_id: 0,
27        }
28        expect(counterSummary).not.toBeUndefined();
29        expect(counterSummary).toMatchInlineSnapshot({
30  value: expect.any(Number),
31  ts: expect.any(Number),
32  counter_id: expect.any(Number) }, `
33Object {
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  start_ts: expect.any(Number),
53  end_ts: expect.any(Number),
54  value: expect.any(Number),
55  column_id: expect.any(Number),
56  slice_message: expect.any(String) }, `
57Object {
58  "column_id": Any<Number>,
59  "end_ts": Any<Number>,
60  "slice_message": Any<String>,
61  "start_ts": Any<Number>,
62  "value": Any<Number>,
63}
64`)
65    });
66})
67