leaked-from-promise.js 247 B

123456789101112131415161718
  1. import test from '../../..';
  2. test('test', t => {
  3. try {
  4. t.throws(throwSync());
  5. } catch (err) {
  6. setImmediate(() => {
  7. throw err;
  8. });
  9. }
  10. return new Promise(() => {});
  11. });
  12. function throwSync() {
  13. throw new Error('should be detected');
  14. }