}
}
-describe('Abstract pool test suite ', () => {
+describe('Abstract pool test suite', () => {
it('Simulate worker not found during increaseWorkersTask', () => {
const pool = new StubPoolWithTasksMapClear(
1,
- './tests/worker/cluster/testWorker.js',
+ './tests/worker-files/cluster/testWorker.js',
{
errorHandler: e => console.error(e)
}
)
- // simulate worker not found.
+ // Simulate worker not found.
pool.removeAllWorker()
expect(() => pool.increaseWorkersTask()).toThrowError(expectedError)
})
it('Simulate worker not found during decreaseWorkersTasks', () => {
const pool = new StubPoolWithTasksMapClear(
1,
- './tests/worker/cluster/testWorker.js',
+ './tests/worker-files/cluster/testWorker.js',
{
errorHandler: e => console.error(e)
}
)
- // simulate worker not found.
+ // Simulate worker not found.
pool.removeAllWorker()
expect(() => pool.decreaseWorkersTasks()).toThrowError(expectedError)
})
expect(() => {
const pool = new StubPoolWithIsMainMethod(
1,
- './tests/worker/cluster/testWorker.js',
+ './tests/worker-files/cluster/testWorker.js',
{
errorHandler: e => console.error(e)
}
)
}).toThrowError()
})
+
+ it('Verify that filePath is checked', () => {
+ expect(() => {
+ const pool = new StubPoolWithIsMainMethod(1).toThrowError()
+ })
+ expect(() => {
+ const pool = new StubPoolWithIsMainMethod(1, '').toThrowError()
+ })
+ })
})