@@ -11,6 +11,7 @@ describe("ScanCreate cases",() => {
1111 params . set ( CxParamType . S , "./src" ) ;
1212 params . set ( CxParamType . FILTER , "*.ts,!**/node_modules/**/*" ) ;
1313 params . set ( CxParamType . BRANCH , "master" ) ;
14+
1415 const auth = new CxWrapper ( cxScanConfig ) ;
1516 const data = await auth . scanCreate ( params ) ;
1617 const cxCommandOutput : CxCommandOutput = data ;
@@ -20,39 +21,39 @@ describe("ScanCreate cases",() => {
2021 expect ( scanShowObject . payload . pop ( ) . Status ) . toEqual ( "Completed" ) ;
2122 } )
2223
23- it ( 'ScanCreate Failure case' , async ( ) => {
24+ it ( 'ScanCreate Successful case with Branch ' , async ( ) => {
2425 const params = new Map ( ) ;
25- params . set ( CxParamType . PROJECT_NAME , "ast-cli-javascript-integration-failure " ) ;
26+ params . set ( CxParamType . PROJECT_NAME , "ast-cli-javascript-integration-success-branch " ) ;
2627 params . set ( CxParamType . S , "./src" ) ;
27- params . set ( CxParamType . SAST_PRESET_NAME , "Checkmarx Default Fake " ) ;
28+ params . set ( CxParamType . FILTER , "*.ts,!**/node_modules/**/* " ) ;
2829 params . set ( CxParamType . BRANCH , "master" ) ;
30+
2931 const auth = new CxWrapper ( cxScanConfig ) ;
30- const cxCommandOutput : CxCommandOutput = await auth . scanCreate ( params ) ;
32+
33+ const data = await auth . scanCreate ( params ) ;
34+ const cxCommandOutput : CxCommandOutput = data ;
3135 const scanObject = cxCommandOutput . payload . pop ( ) ;
3236 const scanShowObject = await auth . scanShow ( scanObject . ID ) ;
33- console . log ( " Json object from failure case: " + JSON . stringify ( scanShowObject ) ) ;
34- expect ( scanShowObject . payload . pop ( ) . Status ) . toEqual ( "Failed" ) ;
35- } )
37+ console . log ( " Json object from successful wait mode case with branch: " + JSON . stringify ( scanShowObject ) ) ;
38+ expect ( scanShowObject . payload . pop ( ) . Status ) . toEqual ( "Completed" ) ;
3639
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- } ) ;
40+ } )
4241
43- it ( 'ScanCreate Successful case with Branch ' , async ( ) => {
42+ it ( 'ScanCreate Failure case' , async ( ) => {
4443 const params = new Map ( ) ;
45- params . set ( CxParamType . PROJECT_NAME , "ast-cli-javascript-integration-success-branch " ) ;
44+ params . set ( CxParamType . PROJECT_NAME , "ast-cli-javascript-integration-failure " ) ;
4645 params . set ( CxParamType . S , "./src" ) ;
47- params . set ( CxParamType . FILTER , "*.ts,!**/node_modules/**/* " ) ;
46+ params . set ( CxParamType . SAST_PRESET_NAME , "Checkmarx Default Fake " ) ;
4847 params . set ( CxParamType . BRANCH , "master" ) ;
48+
4949 const auth = new CxWrapper ( cxScanConfig ) ;
50- const cxCommandOutput : CxCommandOutput = await auth . scanCreate ( params ) ;
50+
51+ const data = await auth . scanCreate ( params ) ;
52+ const cxCommandOutput : CxCommandOutput = data ;
5153 const scanObject = cxCommandOutput . payload . pop ( ) ;
5254 const scanShowObject = await auth . scanShow ( scanObject . ID ) ;
53- console . log ( " Json object from successful wait mode case with branch: " + JSON . stringify ( scanShowObject ) ) ;
54- expect ( scanShowObject . payload . pop ( ) . Status ) . toEqual ( "Completed" ) ;
55-
55+ console . log ( " Json object from failure case: " + JSON . stringify ( scanShowObject ) ) ;
56+ expect ( scanShowObject . payload . pop ( ) . Status ) . toEqual ( "Failed" ) ;
5657 } )
5758
5859 it ( 'ScanCreate Successful case no wait mode' , async ( ) => {
@@ -62,11 +63,21 @@ describe("ScanCreate cases",() => {
6263 params . set ( CxParamType . SAST_PRESET_NAME , "Checkmarx Default Fake" ) ;
6364 params . set ( CxParamType . ADDITIONAL_PARAMETERS , "--async" ) ;
6465 params . set ( CxParamType . BRANCH , "master" ) ;
66+
6567 const auth = new CxWrapper ( cxScanConfig ) ;
66- const cxCommandOutput : CxCommandOutput = await auth . scanCreate ( params ) ;
68+
69+ const data = await auth . scanCreate ( params ) ;
70+ const cxCommandOutput : CxCommandOutput = data ;
6771 const scanObject = cxCommandOutput . payload . pop ( ) ;
6872 const scanShowObject = await auth . scanShow ( scanObject . ID ) ;
69- console . log ( " Json object from successful no wait mode case: " + JSON . stringify ( scanShowObject ) ) ;
70- expect ( scanShowObject . payload . pop ( ) . Status ) . toEqual ( "Running" ) ;
73+ console . log ( " Json object from successful no wait mode case: " + JSON . stringify ( scanShowObject ) )
74+ expect ( scanShowObject . payload . pop ( ) . Status ) . toEqual ( "Running" )
7175 } )
76+
77+ it ( 'ScanList Successful case' , async ( ) => {
78+ const auth = new CxWrapper ( cxScanConfig ) ;
79+ const data = await auth . scanList ( "" ) ;
80+ const cxCommandOutput : CxCommandOutput = data ;
81+ expect ( cxCommandOutput . payload . length ) . toBeGreaterThan ( 0 ) ;
82+ } ) ;
7283} ) ;
0 commit comments