Files
Botexercito/Frontend/angular-internal-chat/node_modules/piscina/test/pool-destroy.ts
T

12 lines
365 B
TypeScript
Raw Normal View History

2026-03-22 18:07:19 +00:00
import Piscina from '..';
import { test } from 'tap';
import { resolve } from 'path';
test('can destroy pool while tasks are running', async ({ rejects }) => {
const pool = new Piscina({
filename: resolve(__dirname, 'fixtures/eval.js')
});
setImmediate(() => pool.destroy());
await rejects(pool.runTask('while(1){}'), /Terminating worker thread/);
});