File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,12 @@ import {CxWrapper} from "./CxWrapper";
22import { CxConfig } from "./CxConfig" ;
33
44class CxWrapperFactory {
5- static async createWrapper ( cxScanConfig : CxConfig , type ?: string , logFilePath ?: string ) {
5+ static async createWrapper ( cxScanConfig : CxConfig , logFilePath ?: string , type ?: string ) : Promise < CxWrapper > {
66 let wrapper : CxWrapper ;
77
88 if ( type === 'mock' ) {
99 wrapper = new CxWrapper ( cxScanConfig , logFilePath ) ;
10- }
11- else {
10+ } else {
1211 wrapper = await CxWrapper . getInstance ( cxScanConfig , logFilePath ) ;
1312 }
1413 await wrapper . init ( ) ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import {CxConfig} from "../main/wrapper/CxConfig";
33import { BaseTest } from "./BaseTest" ;
44import CxWrapperFactory from "../main/wrapper/CxWrapperFactory" ;
55
6- describe ( "Authentication validation" , ( ) => {
6+ describe ( "Authentication validation" , ( ) => {
77 const cxScanConfig = new BaseTest ( ) ;
88 it ( 'Result authentication successful case' , async ( ) => {
99 const auth = await CxWrapperFactory . createWrapper ( cxScanConfig ) ;
@@ -18,7 +18,7 @@ describe("Authentication validation",() => {
1818 cxScanConfig_fail . clientSecret = "error" ;
1919 cxScanConfig_fail . tenant = process . env [ "CX_TENANT" ] ;
2020 cxScanConfig_fail . apiKey = "error" ;
21- const auth = await CxWrapperFactory . createWrapper ( cxScanConfig_fail , 'mock' ) ;
21+ const auth = await CxWrapperFactory . createWrapper ( cxScanConfig_fail , null , 'mock' ) ;
2222 const cxCommandOutput : CxCommandOutput = await auth . authValidate ( ) ;
2323 expect ( cxCommandOutput . exitCode ) . toBe ( 1 ) ;
2424 } ) ;
You can’t perform that action at this time.
0 commit comments