Merge dependabot/npm_and_yarn/examples/typescript/websocket-server-pool/ws-hybrid...
[poolifier.git] / tests / pools / thread / dynamic.test.mjs
index 0a608a01f2d9d478b9fc4a17c388bcb1ac89b4dd..4fcd2d1b039c3c27e3c3308399c25e2c94a1867c 100644 (file)
@@ -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