error = e
}
expect(result).toStrictEqual({ ok: 1 })
- expect(error).toStrictEqual(
- new TypeError('Found invalid object in transferList')
+ expect(error).toBeInstanceOf(Error)
+ expect(error.message).toMatch(
+ /Found invalid (object|value) in transferList/
)
})
await pool.destroy()
})
- it('Verify that a pool with zero worker fails', async () => {
+ it('Verify that a pool with zero worker fails', () => {
expect(
() => new FixedThreadPool(0, './tests/worker-files/thread/testWorker.mjs')
- ).toThrowError('Cannot instantiate a fixed pool with zero worker')
+ ).toThrow('Cannot instantiate a fixed pool with zero worker')
})
})