Skip to content

Commit 88a6161

Browse files
committed
refactor
1 parent bde1814 commit 88a6161

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/main/wrapper/CxWrapperFactory.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ import {CxWrapper} from "./CxWrapper";
22
import {CxConfig} from "./CxConfig";
33

44
class 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();

src/tests/AuthTest.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {CxConfig} from "../main/wrapper/CxConfig";
33
import {BaseTest} from "./BaseTest";
44
import 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
});

0 commit comments

Comments
 (0)