X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Fpools%2Fthread%2Ffixed.test.js;h=755ccf4d4fa2aa12b0621344d1010af377431248;hb=e901162fa610e2af305aac504549580b2de48cab;hp=a5ec3f0a8a63e720b1c789e9a23249a1ca866a4f;hpb=5c5a1fb79906f18560012263239e7bd611ee8d2b;p=poolifier.git diff --git a/tests/pools/thread/fixed.test.js b/tests/pools/thread/fixed.test.js index a5ec3f0a..755ccf4d 100644 --- a/tests/pools/thread/fixed.test.js +++ b/tests/pools/thread/fixed.test.js @@ -4,17 +4,22 @@ const numberOfThreads = 10 const maxTasks = 400 const pool = new FixedThreadPool( numberOfThreads, - './tests/worker/thread/testWorker.js', + './tests/worker-files/thread/testWorker.js', { - errorHandler: e => console.error(e), - onlineHandler: () => console.log('worker is online') + errorHandler: e => console.error(e) } ) -const emptyPool = new FixedThreadPool(1, './tests/worker/thread/emptyWorker.js') -const echoPool = new FixedThreadPool(1, './tests/worker/thread/echoWorker.js') +const emptyPool = new FixedThreadPool( + 1, + './tests/worker-files/thread/emptyWorker.js' +) +const echoPool = new FixedThreadPool( + 1, + './tests/worker-files/thread/echoWorker.js' +) const errorPool = new FixedThreadPool( 1, - './tests/worker/thread/errorWorker.js', + './tests/worker-files/thread/errorWorker.js', { errorHandler: e => console.error(e), onlineHandler: () => console.log('worker is online') @@ -22,7 +27,7 @@ const errorPool = new FixedThreadPool( ) const asyncPool = new FixedThreadPool( 1, - './tests/worker/thread/asyncWorker.js', + './tests/worker-files/thread/asyncWorker.js', { maxTasks: maxTasks } ) @@ -111,7 +116,10 @@ describe('Fixed thread pool test suite ', () => { }) it('Should work even without opts in input', async () => { - const pool1 = new FixedThreadPool(1, './tests/worker/thread/testWorker.js') + const pool1 = new FixedThreadPool( + 1, + './tests/worker-files/thread/testWorker.js' + ) const res = await pool1.execute({ test: 'test' }) expect(res).toBeFalsy() })