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";
2
2
import { CxConfig } from "./CxConfig" ;
3
3
4
4
class CxWrapperFactory {
5
- static async createWrapper ( cxScanConfig : CxConfig , type ?: string , logFilePath ?: string ) {
5
+ static async createWrapper ( cxScanConfig : CxConfig , logFilePath ?: string , type ?: string ) : Promise < CxWrapper > {
6
6
let wrapper : CxWrapper ;
7
7
8
8
if ( type === 'mock' ) {
9
9
wrapper = new CxWrapper ( cxScanConfig , logFilePath ) ;
10
- }
11
- else {
10
+ } else {
12
11
wrapper = await CxWrapper . getInstance ( cxScanConfig , logFilePath ) ;
13
12
}
14
13
await wrapper . init ( ) ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import {CxConfig} from "../main/wrapper/CxConfig";
3
3
import { BaseTest } from "./BaseTest" ;
4
4
import CxWrapperFactory from "../main/wrapper/CxWrapperFactory" ;
5
5
6
- describe ( "Authentication validation" , ( ) => {
6
+ describe ( "Authentication validation" , ( ) => {
7
7
const cxScanConfig = new BaseTest ( ) ;
8
8
it ( 'Result authentication successful case' , async ( ) => {
9
9
const auth = await CxWrapperFactory . createWrapper ( cxScanConfig ) ;
@@ -18,7 +18,7 @@ describe("Authentication validation",() => {
18
18
cxScanConfig_fail . clientSecret = "error" ;
19
19
cxScanConfig_fail . tenant = process . env [ "CX_TENANT" ] ;
20
20
cxScanConfig_fail . apiKey = "error" ;
21
- const auth = await CxWrapperFactory . createWrapper ( cxScanConfig_fail , 'mock' ) ;
21
+ const auth = await CxWrapperFactory . createWrapper ( cxScanConfig_fail , null , 'mock' ) ;
22
22
const cxCommandOutput : CxCommandOutput = await auth . authValidate ( ) ;
23
23
expect ( cxCommandOutput . exitCode ) . toBe ( 1 ) ;
24
24
} ) ;
You can’t perform that action at this time.
0 commit comments