source: trip-planner-front/node_modules/piscina/test/pool-destroy.ts@ 76712b2

Last change on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 365 bytes
Line 
1import Piscina from '..';
2import { test } from 'tap';
3import { resolve } from 'path';
4
5test('can destroy pool while tasks are running', async ({ rejects }) => {
6 const pool = new Piscina({
7 filename: resolve(__dirname, 'fixtures/eval.js')
8 });
9 setImmediate(() => pool.destroy());
10 await rejects(pool.runTask('while(1){}'), /Terminating worker thread/);
11});
Note: See TracBrowser for help on using the repository browser.