Check in UTs the error message thrown in worker-thread pool
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 8 Oct 2022 13:23:33 +0000 (15:23 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 8 Oct 2022 13:23:33 +0000 (15:23 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
tests/pools/thread/fixed.test.js

index 763e3f881dbc066d5b868e981608d1730a3668e7..785c6e5d2d01c8801c0e34e1d33bc292bd543347 100644 (file)
@@ -103,6 +103,7 @@ describe('Fixed thread pool test suite', () => {
     expect(inError).toBeInstanceOf(Error)
     expect(inError.message).toBeDefined()
     expect(typeof inError.message === 'string').toBe(true)
+    expect(inError.message).toBe('Error Message from ThreadWorker')
   })
 
   it('Verify that error handling is working properly:async', async () => {
@@ -117,6 +118,7 @@ describe('Fixed thread pool test suite', () => {
     expect(inError).toBeInstanceOf(Error)
     expect(inError.message).toBeDefined()
     expect(typeof inError.message === 'string').toBe(true)
+    expect(inError.message).toBe('Error Message from ThreadWorker:async')
   })
 
   it('Verify that async function is working properly', async () => {