File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,9 @@ export default class CxOssResult {
1414
1515 static parseResult ( resultObject : any ) : CxOssResult [ ] {
1616 let ossResults : CxOssResult [ ] = [ ] ;
17- const ossResult = new CxOssResult ( ) ;
1817 if ( resultObject instanceof Array ) {
1918 ossResults = resultObject . map ( ( member : any ) => {
19+ const ossResult = new CxOssResult ( ) ;
2020 ossResult . packageManager = member . PackageManager ;
2121 ossResult . packageName = member . PackageName ;
2222 ossResult . version = member . Version ;
@@ -29,6 +29,7 @@ export default class CxOssResult {
2929 return ossResult ;
3030 } ) ;
3131 } else {
32+ const ossResult = new CxOssResult ( ) ;
3233 ossResult . packageManager = resultObject . PackageManager ;
3334 ossResult . packageName = resultObject . PackageName ;
3435 ossResult . version = resultObject . Version ;
Original file line number Diff line number Diff line change 1+ import { CxWrapper } from '../main/wrapper/CxWrapper' ;
2+ import { CxCommandOutput } from "../main/wrapper/CxCommandOutput" ;
3+ import { BaseTest } from "./BaseTest" ;
4+ import { CxParamType } from "../main/wrapper/CxParamType" ;
5+ import CxScan from "../main/scan/CxScan" ;
6+
7+ describe ( "ProjectList cases" , ( ) => {
8+ const cxScanConfig = new BaseTest ( ) ;
9+
10+ it ( 'ScanAsca Successful case' , async ( ) => {
11+ const auth = new CxWrapper ( cxScanConfig ) ;
12+ const cxCommandOutput : CxCommandOutput = await auth . scanOSS ( "tsc/tests/data/python-vul-file.py" ) ;
13+ console . log ( "Json object from scanOSS successful case: " + JSON . stringify ( cxCommandOutput ) ) ;
14+ const scanObject = cxCommandOutput . payload . pop ( ) ;
15+ expect ( cxCommandOutput . payload ) . toBeDefined ( ) ;
16+ expect ( cxCommandOutput . exitCode ) . toBe ( 0 ) ;
17+ } ) ;
18+ } ) ;
You can’t perform that action at this time.
0 commit comments