From f7ae7783bd6dfa3d2d2d998a7b05c59c352f3766 Mon Sep 17 00:00:00 2001 From: mikiher Date: Thu, 14 Mar 2024 19:58:42 +0200 Subject: [PATCH] Fix broken BinaryManager.isBinaryGood test --- test/server/managers/BinaryManager.test.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/server/managers/BinaryManager.test.js b/test/server/managers/BinaryManager.test.js index 48aa5e3f..e13b0ced 100644 --- a/test/server/managers/BinaryManager.test.js +++ b/test/server/managers/BinaryManager.test.js @@ -291,6 +291,7 @@ describe('isBinaryGood', () => { const binaryPath = '/path/to/binary' const execCommand = '"' + binaryPath + '"' + ' -version' + const goodVersions = ['5.1', '6'] beforeEach(() => { binaryManager = new BinaryManager() @@ -306,7 +307,7 @@ describe('isBinaryGood', () => { it('should return false if binaryPath is falsy', async () => { fsPathExistsStub.resolves(true) - const result = await binaryManager.isBinaryGood(null) + const result = await binaryManager.isBinaryGood(null, goodVersions) expect(result).to.be.false expect(fsPathExistsStub.called).to.be.false @@ -316,7 +317,7 @@ describe('isBinaryGood', () => { it('should return false if binaryPath does not exist', async () => { fsPathExistsStub.resolves(false) - const result = await binaryManager.isBinaryGood(binaryPath) + const result = await binaryManager.isBinaryGood(binaryPath, goodVersions) expect(result).to.be.false expect(fsPathExistsStub.calledOnce).to.be.true @@ -328,7 +329,7 @@ describe('isBinaryGood', () => { fsPathExistsStub.resolves(true) execStub.rejects(new Error('Failed to execute command')) - const result = await binaryManager.isBinaryGood(binaryPath) + const result = await binaryManager.isBinaryGood(binaryPath, goodVersions) expect(result).to.be.false expect(fsPathExistsStub.calledOnce).to.be.true @@ -342,7 +343,7 @@ describe('isBinaryGood', () => { fsPathExistsStub.resolves(true) execStub.resolves({ stdout }) - const result = await binaryManager.isBinaryGood(binaryPath) + const result = await binaryManager.isBinaryGood(binaryPath, goodVersions) expect(result).to.be.false expect(fsPathExistsStub.calledOnce).to.be.true @@ -356,7 +357,7 @@ describe('isBinaryGood', () => { fsPathExistsStub.resolves(true) execStub.resolves({ stdout }) - const result = await binaryManager.isBinaryGood(binaryPath) + const result = await binaryManager.isBinaryGood(binaryPath, goodVersions) expect(result).to.be.false expect(fsPathExistsStub.calledOnce).to.be.true @@ -370,7 +371,7 @@ describe('isBinaryGood', () => { fsPathExistsStub.resolves(true) execStub.resolves({ stdout }) - const result = await binaryManager.isBinaryGood(binaryPath) + const result = await binaryManager.isBinaryGood(binaryPath, goodVersions) expect(result).to.be.true expect(fsPathExistsStub.calledOnce).to.be.true