issue-513.ts 422 B

12345678910111213141516171819
  1. import Piscina from '..';
  2. import { test } from 'tap';
  3. import { resolve } from 'path';
  4. test('pool will maintain run and wait time histograms', async ({
  5. equal,
  6. fail
  7. }) => {
  8. const pool = new Piscina({
  9. filename: resolve(__dirname, 'fixtures/vm.js')
  10. });
  11. try {
  12. await pool.run({ payload: 'throw new Error("foo")' });
  13. fail('Expected an error');
  14. } catch (error) {
  15. equal(error.message, 'foo');
  16. }
  17. });