X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=tests%2Fpools%2Fthread%2Fdynamic.test.mjs;h=4fcd2d1b039c3c27e3c3308399c25e2c94a1867c;hb=e5a344fa6735e9df8cf1a39dddc749a4dd0f8579;hp=0a608a01f2d9d478b9fc4a17c388bcb1ac89b4dd;hpb=a074ffee1b46f43d0dcfba58128748c7492104dd;p=poolifier.git diff --git a/tests/pools/thread/dynamic.test.mjs b/tests/pools/thread/dynamic.test.mjs index 0a608a01..4fcd2d1b 100644 --- a/tests/pools/thread/dynamic.test.mjs +++ b/tests/pools/thread/dynamic.test.mjs @@ -9,7 +9,7 @@ describe('Dynamic thread pool test suite', () => { const pool = new DynamicThreadPool( min, max, - './tests/worker-files/thread/testWorker.js', + './tests/worker-files/thread/testWorker.mjs', { errorHandler: e => console.error(e) } @@ -73,8 +73,8 @@ describe('Dynamic thread pool test suite', () => { }) it('Validation of inputs test', () => { - expect(() => new DynamicThreadPool(min)).toThrowError( - 'Please specify a file with a worker implementation' + expect(() => new DynamicThreadPool(min)).toThrow( + "Cannot find the worker file 'undefined'" ) }) @@ -82,7 +82,7 @@ describe('Dynamic thread pool test suite', () => { const pool = new DynamicThreadPool( min, max, - './tests/worker-files/thread/testWorker.js' + './tests/worker-files/thread/testWorker.mjs' ) const res = await pool.execute() expect(res).toStrictEqual({ ok: 1 }) @@ -94,7 +94,7 @@ describe('Dynamic thread pool test suite', () => { const longRunningPool = new DynamicThreadPool( min, max, - './tests/worker-files/thread/longRunningWorkerHardBehavior.js', + './tests/worker-files/thread/longRunningWorkerHardBehavior.mjs', { errorHandler: e => console.error(e), onlineHandler: () => console.info('long executing worker is online'), @@ -121,7 +121,7 @@ describe('Dynamic thread pool test suite', () => { const longRunningPool = new DynamicThreadPool( min, max, - './tests/worker-files/thread/longRunningWorkerSoftBehavior.js', + './tests/worker-files/thread/longRunningWorkerSoftBehavior.mjs', { errorHandler: e => console.error(e), onlineHandler: () => console.info('long executing worker is online'), @@ -144,7 +144,7 @@ describe('Dynamic thread pool test suite', () => { const pool = new DynamicThreadPool( 0, max, - './tests/worker-files/thread/testWorker.js' + './tests/worker-files/thread/testWorker.mjs' ) expect(pool).toBeInstanceOf(DynamicThreadPool) // We need to clean up the resources after our test