79376222

Date: 2025-01-22 00:04:53
Score: 0.5
Natty:
Report link

adding jest.useRealTimers(); to my test fixed this for me. Didn't need the setImmediate patch.

My minimal example reproducing this was

import ExcelJS from 'exceljs';
...
it('test excel write to buffer', async () => {
  const workbook = new ExcelJS.Workbook();
  workbook.addWorksheet('Sheet1');
  await workbook.xlsx.writeBuffer(); // uses jszip internally and times out
});

Fixed:

...
it('test excel write to buffer', async () => {
  jest.useRealTimers();
  const workbook = new ExcelJS.Workbook();
  ...
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Schuyler Fried