test: use arrow noop task function
[poolifier.git] / tests / worker / abstract-worker.test.mjs
index d94cd4400d2cd70cb7f618c4b1af773700d8a6ec..67834a4c543e1111c0db8a8de03705c9bf1128da 100644 (file)
@@ -136,7 +136,7 @@ describe('Abstract worker test suite', () => {
   })
 
   it('Verify that taskFunctions parameter with unique function is taken', () => {
-    const worker = new ThreadWorker(EMPTY_FUNCTION)
+    const worker = new ThreadWorker(() => {})
     expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual({
       taskFunction: expect.any(Function)
     })
@@ -174,13 +174,13 @@ describe('Abstract worker test suite', () => {
     )
     expect(
       () => new ThreadWorker({ fn1: { taskFunction: fn1, priority: '' } })
-    ).toThrow(new TypeError("Invalid priority ''"))
+    ).toThrow(new TypeError("Invalid property 'priority': ''"))
     expect(
       () => new ThreadWorker({ fn1: { taskFunction: fn1, priority: -21 } })
-    ).toThrow(new TypeError('Property priority must be between -20 and 19'))
+    ).toThrow(new TypeError("Property 'priority' must be between -20 and 19"))
     expect(
       () => new ThreadWorker({ fn1: { taskFunction: fn1, priority: 20 } })
-    ).toThrow(new RangeError('Property priority must be between -20 and 19'))
+    ).toThrow(new RangeError("Property 'priority' must be between -20 and 19"))
     expect(
       () =>
         new ThreadWorker({
@@ -352,7 +352,7 @@ describe('Abstract worker test suite', () => {
     )
   })
 
-  it('Verify that listTaskFunctionNames() is working', () => {
+  it('Verify that listTaskFunctionsProperties() is working', () => {
     const fn1 = () => {
       return 1
     }