Repository navigation
Expand file tree
/
Copy pathTelemetryTest.test.ts
More file actions
56 lines (51 loc) · 1.9 KB
/
Copy pathTelemetryTest.test.ts
File metadata and controls
56 lines (51 loc) · 1.9 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
46
47
48
49
50
51
52
53
54
55
56
import { CxWrapper } from '../main/wrapper/CxWrapper';
import { CxCommandOutput } from "../main/wrapper/CxCommandOutput";
import { BaseTest } from "./BaseTest";
describe("Telemetry cases", () => {
const cxScanConfig = new BaseTest();
it('TelemetryAIEvent Successful case with minimal parameters - ai log', async () => {
const wrapper = new CxWrapper(cxScanConfig);
const cxCommandOutput: CxCommandOutput = await wrapper.telemetryAIEvent(
"Cursor",
"click",
"ast-results.viewPackageDetails",
"secrets",
"high",
"",
"",
0
);
console.log("Json object from telemetryAIEvent successful case: " + JSON.stringify(cxCommandOutput));
expect(cxCommandOutput.exitCode).toBe(0);
});
it('TelemetryAIEvent Successful case with minimal parameters - detection log', async () => {
const wrapper = new CxWrapper(cxScanConfig);
const cxCommandOutput: CxCommandOutput = await wrapper.telemetryAIEvent(
"",
"",
"",
"",
"",
"asca",
"Critical",
10
);
console.log("Json object from telemetryAIEvent successful case: " + JSON.stringify(cxCommandOutput));
expect(cxCommandOutput.exitCode).toBe(0);
});
it('TelemetryAIEvent Successful case with edge case parameters', async () => {
const wrapper = new CxWrapper(cxScanConfig);
const cxCommandOutput: CxCommandOutput = await wrapper.telemetryAIEvent(
"",
"",
"",
"",
"",
"",
"",
0
);
console.log("Json object from telemetryAIEvent with empty parameters: " + JSON.stringify(cxCommandOutput));
expect(cxCommandOutput.exitCode).toBe(0);
});
});