@@ -3,10 +3,12 @@ import { CxParamType } from "../main/wrapper/CxParamType";
33import { BaseTest } from "./BaseTest" ;
44import CxWrapperFactory from "../main/wrapper/CxWrapperFactory" ;
55
6+ const cxWrapperFactory = new CxWrapperFactory ( ) ;
7+
68describe ( "ScanCreate cases" , ( ) => {
79 const cxScanConfig = new BaseTest ( ) ;
810 it ( 'ScanList Successful case' , async ( ) => {
9- const auth = await CxWrapperFactory . createWrapper ( cxScanConfig ) ;
11+ const auth = await cxWrapperFactory . createWrapper ( cxScanConfig ) ;
1012 const cxCommandOutput : CxCommandOutput = await auth . scanList ( "" ) ;
1113 console . log ( " Json object from scanList successful case: " + JSON . stringify ( cxCommandOutput ) ) ;
1214 expect ( cxCommandOutput . payload . length ) . toBeGreaterThan ( 1 ) ;
@@ -20,7 +22,7 @@ describe("ScanCreate cases", () => {
2022 params . set ( CxParamType . FILTER , "*.ts,!**/node_modules/**/*" ) ;
2123 params . set ( CxParamType . BRANCH , "master" ) ;
2224 params . set ( CxParamType . SCAN_TYPES , "kics" ) ;
23- const auth = await CxWrapperFactory . createWrapper ( cxScanConfig ) ;
25+ const auth = await cxWrapperFactory . createWrapper ( cxScanConfig ) ;
2426 const cxCommandOutput : CxCommandOutput = await auth . scanCreate ( params ) ;
2527 const scanObject = cxCommandOutput . payload . pop ( ) ;
2628 const scanShowObject = await auth . scanShow ( scanObject . id ) ;
@@ -35,7 +37,7 @@ describe("ScanCreate cases", () => {
3537 params . set ( CxParamType . SAST_PRESET_NAME , "Checkmarx Default Fake" ) ;
3638 params . set ( CxParamType . BRANCH , "master" ) ;
3739 params . set ( CxParamType . SCAN_TYPES , "sast" ) ;
38- const auth = await CxWrapperFactory . createWrapper ( cxScanConfig ) ;
40+ const auth = await cxWrapperFactory . createWrapper ( cxScanConfig ) ;
3941 const cxCommandOutput : CxCommandOutput = await auth . scanCreate ( params ) ;
4042 const scanObject = cxCommandOutput . payload . pop ( ) ;
4143 const scanShowObject = await auth . scanShow ( scanObject . id ) ;
@@ -50,7 +52,7 @@ describe("ScanCreate cases", () => {
5052 params . set ( CxParamType . FILTER , "*.ts,!**/node_modules/**/*" ) ;
5153 params . set ( CxParamType . BRANCH , "master" ) ;
5254 params . set ( CxParamType . ADDITIONAL_PARAMETERS , "--scan-types sast" ) ;
53- const auth = await CxWrapperFactory . createWrapper ( cxScanConfig ) ;
55+ const auth = await cxWrapperFactory . createWrapper ( cxScanConfig ) ;
5456 const cxCommandOutput : CxCommandOutput = await auth . scanCreate ( params ) ;
5557 const scanObject = cxCommandOutput . payload . pop ( ) ;
5658 const scanShowObject = await auth . scanShow ( scanObject . id ) ;
@@ -66,7 +68,7 @@ describe("ScanCreate cases", () => {
6668 params . set ( CxParamType . SAST_PRESET_NAME , "Checkmarx Default Fake" ) ;
6769 params . set ( CxParamType . ADDITIONAL_PARAMETERS , "--async" ) ;
6870 params . set ( CxParamType . BRANCH , "master" ) ;
69- const auth = await CxWrapperFactory . createWrapper ( cxScanConfig ) ;
71+ const auth = await cxWrapperFactory . createWrapper ( cxScanConfig ) ;
7072 const cxCommandOutput : CxCommandOutput = await auth . scanCreate ( params ) ;
7173 const scanObject = cxCommandOutput . payload . pop ( ) ;
7274 const scanShowObject = await auth . scanShow ( scanObject . id ) ;
@@ -81,7 +83,7 @@ describe("ScanCreate cases", () => {
8183 params . set ( CxParamType . BRANCH , "master" ) ;
8284 params . set ( CxParamType . FILTER , "*.ts,!**/node_modules/**/*" ) ;
8385 params . set ( CxParamType . ADDITIONAL_PARAMETERS , "--async" ) ;
84- const auth = await CxWrapperFactory . createWrapper ( cxScanConfig ) ;
86+ const auth = await cxWrapperFactory . createWrapper ( cxScanConfig ) ;
8587 const cxCommandOutput : CxCommandOutput = await auth . scanCreate ( params ) ;
8688 const scanObject = cxCommandOutput . payload . pop ( ) ;
8789 await auth . scanCancel ( scanObject . id )
@@ -90,7 +92,7 @@ describe("ScanCreate cases", () => {
9092 } )
9193
9294 it ( 'KicsRealtime Successful case ' , async ( ) => {
93- const auth = await CxWrapperFactory . createWrapper ( cxScanConfig ) ;
95+ const auth = await cxWrapperFactory . createWrapper ( cxScanConfig ) ;
9496 const [ outputProcess , pid ] = await auth . kicsRealtimeScan ( "dist/tests/data/Dockerfile" , "docker" , "-v" ) ;
9597 const cxCommandOutput : CxCommandOutput = await outputProcess ;
9698 console . log ( " Json object from successful no wait mode case: " + JSON . stringify ( cxCommandOutput . payload ) ) ;
@@ -101,7 +103,7 @@ describe("ScanCreate cases", () => {
101103 } )
102104
103105 it ( 'ScaRealtime Successful case' , async ( ) => {
104- const wrapper = await CxWrapperFactory . createWrapper ( cxScanConfig ) ;
106+ const wrapper = await cxWrapperFactory . createWrapper ( cxScanConfig ) ;
105107 const cxCommandOutput : CxCommandOutput = await wrapper . runScaRealtimeScan ( process . cwd ( ) ) ;
106108 if ( cxCommandOutput . exitCode == 1 ) {
107109 expect ( cxCommandOutput . payload ) . toBeUndefined ( ) ;
@@ -113,20 +115,20 @@ describe("ScanCreate cases", () => {
113115
114116 it ( "Should check if scan create is possible" , async ( ) => {
115117 const cxScanConfig = new BaseTest ( ) ;
116- const auth = await CxWrapperFactory . createWrapper ( cxScanConfig ) ;
118+ const auth = await cxWrapperFactory . createWrapper ( cxScanConfig ) ;
117119 const tenantSettings : boolean = await auth . ideScansEnabled ( ) ;
118120 expect ( tenantSettings ) . toBeDefined ( ) ;
119121 } )
120122
121123 it ( "Should check if AI guided remediation is active" , async ( ) => {
122124 const cxScanConfig = new BaseTest ( ) ;
123- const auth = await CxWrapperFactory . createWrapper ( cxScanConfig ) ;
125+ const auth = await cxWrapperFactory . createWrapper ( cxScanConfig ) ;
124126 const aiEnabled : boolean = await auth . guidedRemediationEnabled ( ) ;
125127 expect ( aiEnabled ) . toBeDefined ( ) ;
126128 } )
127129
128130 it ( 'ScanVorpal fail case Without extensions' , async ( ) => {
129- const auth = await CxWrapperFactory . createWrapper ( cxScanConfig ) ;
131+ const auth = await cxWrapperFactory . createWrapper ( cxScanConfig ) ;
130132 const cxCommandOutput : CxCommandOutput = await auth . scanVorpal ( "tsc/tests/data/python-file" ) ;
131133 console . log ( " Json object from failure case: " + JSON . stringify ( cxCommandOutput ) ) ;
132134
@@ -136,7 +138,7 @@ describe("ScanCreate cases", () => {
136138 } ) ;
137139
138140 it ( 'ScanVorpal Successful case' , async ( ) => {
139- const auth = await CxWrapperFactory . createWrapper ( cxScanConfig ) ;
141+ const auth = await cxWrapperFactory . createWrapper ( cxScanConfig ) ;
140142 const cxCommandOutput : CxCommandOutput = await auth . scanVorpal ( "tsc/tests/data/python-vul-file.py" ) ;
141143 console . log ( "Json object from scanVorpal successful case: " + JSON . stringify ( cxCommandOutput ) ) ;
142144 const scanObject = cxCommandOutput . payload . pop ( ) ;
@@ -146,7 +148,7 @@ describe("ScanCreate cases", () => {
146148 } ) ;
147149
148150 it ( 'ScanVorpal with complex name Successful case' , async ( ) => {
149- const auth = await CxWrapperFactory . createWrapper ( cxScanConfig ) ;
151+ const auth = await cxWrapperFactory . createWrapper ( cxScanConfig ) ;
150152 const cxCommandOutput : CxCommandOutput = await auth . scanVorpal ( "tsc/tests/data/var express = require('express';.js" ) ;
151153 console . log ( "Json object from scanVorpal successful case: " + JSON . stringify ( cxCommandOutput ) ) ;
152154 const scanObject = cxCommandOutput . payload . pop ( ) ;
@@ -156,7 +158,7 @@ describe("ScanCreate cases", () => {
156158 } ) ;
157159
158160 it ( 'ScanVorpal Successful case with update version' , async ( ) => {
159- const auth = await CxWrapperFactory . createWrapper ( cxScanConfig ) ;
161+ const auth = await cxWrapperFactory . createWrapper ( cxScanConfig ) ;
160162 const cxCommandOutput : CxCommandOutput = await auth . scanVorpal ( "tsc/tests/data/python-vul-file.py" , true ) ;
161163 console . log ( "Json object from scanVorpal successful case with update version: " + JSON . stringify ( cxCommandOutput ) ) ;
162164 const scanObject = cxCommandOutput . payload . pop ( ) ;
0 commit comments