test: add pool statuses test
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 26 Aug 2023 19:59:26 +0000 (21:59 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 26 Aug 2023 19:59:26 +0000 (21:59 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
tests/pools/abstract/abstract-pool.test.js

index 37729cee58bfabc542629a070d5d7445a30f9bd5..ddb0534f67d4a685cb0b8630d6282fdc217cfc0d 100644 (file)
@@ -44,6 +44,17 @@ describe('Abstract pool test suite', () => {
     )
   })
 
+  it('Verify that pool statuses properties are set', async () => {
+    const pool = new FixedThreadPool(
+      numberOfWorkers,
+      './tests/worker-files/thread/testWorker.js'
+    )
+    expect(pool.starting).toBe(false)
+    expect(pool.started).toBe(true)
+    await pool.destroy()
+    expect(pool.started).toBe(false)
+  })
+
   it('Verify that filePath is checked', () => {
     const expectedError = new Error(
       'Please specify a file with a worker implementation'