@@ -6,12 +6,6 @@ import {BaseTest} from "./BaseTest";
66describe ( "ScanCreate cases" , ( ) => {
77 let cxScanConfig = new BaseTest ( ) ;
88
9- it ( 'ScanList Successful case' , async ( ) => {
10- const auth = new CxWrapper ( cxScanConfig ) ;
11- const cxCommandOutput : CxCommandOutput = await auth . scanList ( "" ) ;
12- expect ( cxCommandOutput . payload . length ) . toBeGreaterThan ( 0 ) ;
13- } ) ;
14-
159 it ( 'ScanCreate Successful case wait mode' , async ( ) => {
1610 const params = new Map ( ) ;
1711 params . set ( CxParamType . PROJECT_NAME , "ast-cli-javascript-integration-success" ) ;
@@ -26,33 +20,39 @@ describe("ScanCreate cases",() => {
2620 expect ( scanShowObject . payload . pop ( ) . Status ) . toEqual ( "Completed" ) ;
2721 } )
2822
29- it ( 'ScanCreate Successful case with Branch ' , async ( ) => {
23+ it ( 'ScanCreate Failure case' , async ( ) => {
3024 const params = new Map ( ) ;
31- params . set ( CxParamType . PROJECT_NAME , "ast-cli-javascript-integration-success-branch " ) ;
25+ params . set ( CxParamType . PROJECT_NAME , "ast-cli-javascript-integration-failure " ) ;
3226 params . set ( CxParamType . S , "./src" ) ;
33- params . set ( CxParamType . FILTER , "*.ts,!**/node_modules/**/* " ) ;
27+ params . set ( CxParamType . SAST_PRESET_NAME , "Checkmarx Default Fake " ) ;
3428 params . set ( CxParamType . BRANCH , "master" ) ;
3529 const auth = new CxWrapper ( cxScanConfig ) ;
3630 const cxCommandOutput : CxCommandOutput = await auth . scanCreate ( params ) ;
3731 const scanObject = cxCommandOutput . payload . pop ( ) ;
3832 const scanShowObject = await auth . scanShow ( scanObject . ID ) ;
39- console . log ( " Json object from successful wait mode case with branch: " + JSON . stringify ( scanShowObject ) ) ;
40- expect ( scanShowObject . payload . pop ( ) . Status ) . toEqual ( "Completed" ) ;
41-
33+ console . log ( " Json object from failure case: " + JSON . stringify ( scanShowObject ) ) ;
34+ expect ( scanShowObject . payload . pop ( ) . Status ) . toEqual ( "Failed" ) ;
4235 } )
4336
44- it ( 'ScanCreate Failure case' , async ( ) => {
37+ it ( 'ScanList Successful case' , async ( ) => {
38+ const auth = new CxWrapper ( cxScanConfig ) ;
39+ const cxCommandOutput : CxCommandOutput = await auth . scanList ( "" ) ;
40+ expect ( cxCommandOutput . payload . length ) . toBeGreaterThan ( 0 ) ;
41+ } ) ;
42+
43+ it ( 'ScanCreate Successful case with Branch' , async ( ) => {
4544 const params = new Map ( ) ;
46- params . set ( CxParamType . PROJECT_NAME , "ast-cli-javascript-integration-failure " ) ;
45+ params . set ( CxParamType . PROJECT_NAME , "ast-cli-javascript-integration-success-branch " ) ;
4746 params . set ( CxParamType . S , "./src" ) ;
48- params . set ( CxParamType . SAST_PRESET_NAME , "Checkmarx Default Fake " ) ;
47+ params . set ( CxParamType . FILTER , "*.ts,!**/node_modules/**/* " ) ;
4948 params . set ( CxParamType . BRANCH , "master" ) ;
5049 const auth = new CxWrapper ( cxScanConfig ) ;
5150 const cxCommandOutput : CxCommandOutput = await auth . scanCreate ( params ) ;
5251 const scanObject = cxCommandOutput . payload . pop ( ) ;
5352 const scanShowObject = await auth . scanShow ( scanObject . ID ) ;
54- console . log ( " Json object from failure case: " + JSON . stringify ( scanShowObject ) ) ;
55- expect ( scanShowObject . payload . pop ( ) . Status ) . toEqual ( "Failed" ) ;
53+ console . log ( " Json object from successful wait mode case with branch: " + JSON . stringify ( scanShowObject ) ) ;
54+ expect ( scanShowObject . payload . pop ( ) . Status ) . toEqual ( "Completed" ) ;
55+
5656 } )
5757
5858 it ( 'ScanCreate Successful case no wait mode' , async ( ) => {
0 commit comments