-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.test.js
More file actions
45 lines (43 loc) · 1.12 KB
/
index.test.js
File metadata and controls
45 lines (43 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { preprocessData } from './index';
test('preprocesses logs successfully', () => {
const logsDataFrame = preprocessData(
{
data: {
attributes: {
logs: [
[
1691409972788,
{
event: 'one',
severity: 'ErrorSeverity',
tags: {
'http.status_code': 200,
large_batch: true,
trace_id: 'd29a3fa8fb446ec65eb691a3259a541e',
},
},
],
[
1691409971908,
{
event: 'two',
severity: 'InfoSeverity',
tags: {
customer: 'hipcore',
large_batch: false,
trace_id: 'd0fa420269652931236c94bc54d2233e',
},
k8s_environment: 'production',
k8s_namespace: 'default',
k8s_pod: 'hipcore-pod',
},
],
],
},
},
},
{ refId: 'a' },
''
);
expect(logsDataFrame.toJSON()).toMatchSnapshot();
});