@@ -127,46 +127,46 @@ describe("ScanCreate cases", () => {
127
127
expect ( aiEnabled ) . toBeDefined ( ) ;
128
128
} )
129
129
130
- // it('ScanVorpal fail case Without extensions', async () => {
131
- // const auth = await cxWrapperFactory.createWrapper(cxScanConfig);
132
- // const cxCommandOutput: CxCommandOutput = await auth.scanVorpal ("tsc/tests/data/python-file");
133
- // console.log(" Json object from failure case: " + JSON.stringify(cxCommandOutput));
134
- //
135
- // expect(cxCommandOutput.payload[0].error.description).toEqual("The file name must have an extension.");
136
- // expect(cxCommandOutput.exitCode).toBe(0);
137
- // expect(cxCommandOutput.payload[0].status).toBeUndefined();
138
- // });
139
-
140
- // it('ScanVorpal Successful case', async () => {
141
- // const auth = await cxWrapperFactory.createWrapper(cxScanConfig);
142
- // const cxCommandOutput: CxCommandOutput = await auth.scanVorpal ("tsc/tests/data/python-vul-file.py");
143
- // console.log("Json object from scanVorpal successful case: " + JSON.stringify(cxCommandOutput));
144
- // const scanObject = cxCommandOutput.payload.pop();
145
- // expect(cxCommandOutput.payload).toBeDefined();
146
- // expect(cxCommandOutput.exitCode).toBe(0);
147
- // expect(scanObject.status).toEqual(true);
148
- // });
149
- //
150
- // it('ScanVorpal with complex name Successful case', async () => {
151
- // const auth = await cxWrapperFactory.createWrapper(cxScanConfig);
152
- // const cxCommandOutput: CxCommandOutput = await auth.scanVorpal ("tsc/tests/data/var express = require('express';.js");
153
- // console.log("Json object from scanVorpal successful case: " + JSON.stringify(cxCommandOutput));
154
- // const scanObject = cxCommandOutput.payload.pop();
155
- // expect(cxCommandOutput.payload).toBeDefined();
156
- // expect(cxCommandOutput.exitCode).toBe(0);
157
- // expect(scanObject.status).toEqual(true);
158
- // });
159
- //
160
- // it('ScanVorpal Successful case with update version', async () => {
161
- // const auth = await cxWrapperFactory.createWrapper(cxScanConfig);
162
- // const cxCommandOutput: CxCommandOutput = await auth.scanVorpal ("tsc/tests/data/python-vul-file.py", true);
163
- // console.log("Json object from scanVorpal successful case with update version: " + JSON.stringify(cxCommandOutput));
164
- // const scanObject = cxCommandOutput.payload.pop();
165
- // expect(cxCommandOutput.payload).toBeDefined();
166
- // expect(cxCommandOutput.exitCode).toBe(0);
167
- // expect(scanObject.status).toEqual(true);
168
- // expect(Number.isInteger(scanObject.scanDetails[0].line)).toBe(true);
169
- // expect(typeof scanObject.scanDetails[0].description).toBe('string');
170
- // });
130
+ it ( 'ScanAsca fail case Without extensions' , async ( ) => {
131
+ const auth = await cxWrapperFactory . createWrapper ( cxScanConfig ) ;
132
+ const cxCommandOutput : CxCommandOutput = await auth . scanAsca ( "tsc/tests/data/python-file" ) ;
133
+ console . log ( " Json object from failure case: " + JSON . stringify ( cxCommandOutput ) ) ;
134
+
135
+ expect ( cxCommandOutput . payload [ 0 ] . error . description ) . toEqual ( "The file name must have an extension." ) ;
136
+ expect ( cxCommandOutput . exitCode ) . toBe ( 0 ) ;
137
+ expect ( cxCommandOutput . payload [ 0 ] . status ) . toBeUndefined ( ) ;
138
+ } ) ;
139
+
140
+ it ( 'ScanAsca Successful case' , async ( ) => {
141
+ const auth = await cxWrapperFactory . createWrapper ( cxScanConfig ) ;
142
+ const cxCommandOutput : CxCommandOutput = await auth . scanAsca ( "tsc/tests/data/python-vul-file.py" ) ;
143
+ console . log ( "Json object from scanAsca successful case: " + JSON . stringify ( cxCommandOutput ) ) ;
144
+ const scanObject = cxCommandOutput . payload . pop ( ) ;
145
+ expect ( cxCommandOutput . payload ) . toBeDefined ( ) ;
146
+ expect ( cxCommandOutput . exitCode ) . toBe ( 0 ) ;
147
+ expect ( scanObject . status ) . toEqual ( true ) ;
148
+ } ) ;
149
+
150
+ it ( 'ScanAsca with complex name Successful case' , async ( ) => {
151
+ const auth = await cxWrapperFactory . createWrapper ( cxScanConfig ) ;
152
+ const cxCommandOutput : CxCommandOutput = await auth . scanAsca ( "tsc/tests/data/var express = require('express';.js" ) ;
153
+ console . log ( "Json object from scanAsca successful case: " + JSON . stringify ( cxCommandOutput ) ) ;
154
+ const scanObject = cxCommandOutput . payload . pop ( ) ;
155
+ expect ( cxCommandOutput . payload ) . toBeDefined ( ) ;
156
+ expect ( cxCommandOutput . exitCode ) . toBe ( 0 ) ;
157
+ expect ( scanObject . status ) . toEqual ( true ) ;
158
+ } ) ;
159
+
160
+ it ( 'ScanAsca Successful case with update version' , async ( ) => {
161
+ const auth = await cxWrapperFactory . createWrapper ( cxScanConfig ) ;
162
+ const cxCommandOutput : CxCommandOutput = await auth . scanAsca ( "tsc/tests/data/python-vul-file.py" , true ) ;
163
+ console . log ( "Json object from scanAsca successful case with update version: " + JSON . stringify ( cxCommandOutput ) ) ;
164
+ const scanObject = cxCommandOutput . payload . pop ( ) ;
165
+ expect ( cxCommandOutput . payload ) . toBeDefined ( ) ;
166
+ expect ( cxCommandOutput . exitCode ) . toBe ( 0 ) ;
167
+ expect ( scanObject . status ) . toEqual ( true ) ;
168
+ expect ( Number . isInteger ( scanObject . scanDetails [ 0 ] . line ) ) . toBe ( true ) ;
169
+ expect ( typeof scanObject . scanDetails [ 0 ] . description ) . toBe ( 'string' ) ;
170
+ } ) ;
171
171
172
172
} ) ;
0 commit comments