source: trip-planner-front/node_modules/piscina/test/pool-destroy.ts@ 8d391a1

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

initial commit

  • Property mode set to 100644
File size: 365 bytes
RevLine 
[6a3a178]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.