gui/ui/node_modules.bak/piscina/test/pool-destroy.test.ts
Snider fad16c8c76
Some checks failed
Security Scan / security (push) Failing after 34s
Test / test (push) Failing after 1m44s
chore: sync workspace dependencies
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-15 15:44:56 +00:00

13 lines
398 B
TypeScript

import assert from 'node:assert/strict';
import { test } from 'node:test';
import { resolve } from 'node:path';
import Piscina from '..';
test('can destroy pool while tasks are running', () => {
const pool = new Piscina({
filename: resolve(__dirname, 'fixtures/eval.js')
});
setImmediate(() => pool.destroy());
assert.rejects(pool.run('while(1){}'), /Terminating worker thread/);
});