Skip to content

Commit 2b3ac83

Browse files
committed
fix cxInstaller tests
1 parent 86dd544 commit 2b3ac83

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/main/osinstaller/CxInstaller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export class CxInstaller {
174174
return fs.existsSync(this.getExecutablePath());
175175
}
176176

177-
private async readASTCLIVersion(): Promise<string> {
177+
async readASTCLIVersion(): Promise<string> {
178178
if (this.cliVersion) {
179179
return this.cliVersion;
180180
}

src/tests/CxInstallerTest.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,23 @@ const cxInstallerWindows = new CxInstaller("win32", astClientInstance);
1414
describe("CxInstaller cases", () => {
1515
it('CxInstaller getDownloadURL Linux Successful case', async () => {
1616
const url = await cxInstallerLinux.getDownloadURL();
17+
const version = await cxInstallerLinux.readASTCLIVersion();
1718
const architecture = getArchitecture(cxInstallerLinux.getPlatform());
18-
expect(url).toBe(`https://download.checkmarx.com/CxOne/CLI/2.2.5/ast-cli_2.2.5_linux_${architecture}.tar.gz`);
19+
expect(url).toBe(`https://download.checkmarx.com/CxOne/CLI/${version}/ast-cli_${version}_linux_${architecture}.tar.gz`);
1920
});
2021

2122
it('CxInstaller getDownloadURL Mac Successful case', async () => {
2223
const url = await cxInstallerMac.getDownloadURL();
24+
const version = await cxInstallerLinux.readASTCLIVersion();
2325
const architecture = getArchitecture(cxInstallerMac.getPlatform());
24-
expect(url).toBe(`https://download.checkmarx.com/CxOne/CLI/2.2.5/ast-cli_2.2.5_darwin_${architecture}.tar.gz`);
26+
expect(url).toBe(`https://download.checkmarx.com/CxOne/CLI/${version}/ast-cli_${version}_darwin_${architecture}.tar.gz`);
2527
});
2628

2729
it('CxInstaller getDownloadURL Windows Successful case', async () => {
2830
const url = await cxInstallerWindows.getDownloadURL();
31+
const version = await cxInstallerLinux.readASTCLIVersion();
2932
const architecture = getArchitecture(cxInstallerWindows.getPlatform());
30-
expect(url).toBe(`https://download.checkmarx.com/CxOne/CLI/2.2.5/ast-cli_2.2.5_windows_${architecture}.zip`);
33+
expect(url).toBe(`https://download.checkmarx.com/CxOne/CLI/${version}/ast-cli_${version}_windows_${architecture}.zip`);
3134
});
3235
});
3336

0 commit comments

Comments
 (0)