horse-betting/btc-ui-app-2/node_modules/piscina/test/pool-destroy.ts
2025-06-19 16:39:08 +05:30

12 lines
361 B
TypeScript

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.run('while(1){}'), /Terminating worker thread/);
});