X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Fpools%2Fabstract%2Fabstract-pool.test.js;h=9b32a7e09fb6d8d9ff9b90de389b9c41d3178ce1;hb=0289646090c766a451aab11e7ab67a65f07221e4;hp=d5d87058ed2c7f1f2f24c9a18347f00199f146f3;hpb=eb3b4c1592abc3f91acfe98c236a02ca994febff;p=poolifier.git diff --git a/tests/pools/abstract/abstract-pool.test.js b/tests/pools/abstract/abstract-pool.test.js index d5d87058..9b32a7e0 100644 --- a/tests/pools/abstract/abstract-pool.test.js +++ b/tests/pools/abstract/abstract-pool.test.js @@ -14,16 +14,16 @@ class StubPoolWithIsMainMethod extends FixedThreadPool { } } -describe('Abstract pool test suite ', () => { +describe('Abstract pool test suite', () => { it('Simulate worker not found during increaseWorkersTask', () => { const pool = new StubPoolWithTasksMapClear( 1, - './tests/worker/cluster/testWorker.js', + './tests/worker-files/cluster/testWorker.js', { errorHandler: e => console.error(e) } ) - // simulate worker not found. + // Simulate worker not found. pool.removeAllWorker() expect(() => pool.increaseWorkersTask()).toThrowError(expectedError) }) @@ -31,12 +31,12 @@ describe('Abstract pool test suite ', () => { it('Simulate worker not found during decreaseWorkersTasks', () => { const pool = new StubPoolWithTasksMapClear( 1, - './tests/worker/cluster/testWorker.js', + './tests/worker-files/cluster/testWorker.js', { errorHandler: e => console.error(e) } ) - // simulate worker not found. + // Simulate worker not found. pool.removeAllWorker() expect(() => pool.decreaseWorkersTasks()).toThrowError(expectedError) }) @@ -45,11 +45,20 @@ describe('Abstract pool test suite ', () => { expect(() => { const pool = new StubPoolWithIsMainMethod( 1, - './tests/worker/cluster/testWorker.js', + './tests/worker-files/cluster/testWorker.js', { errorHandler: e => console.error(e) } ) }).toThrowError() }) + + it('Verify that filePath is checked', () => { + expect(() => { + const pool = new StubPoolWithIsMainMethod(1).toThrowError() + }) + expect(() => { + const pool = new StubPoolWithIsMainMethod(1, '').toThrowError() + }) + }) })