TypeError when testing with Jest and Formidable

Viewed 18

I have wrote a cusom express middleware to pars an incoming multipart form. The middleware works fine when launched in local or deployed but the test with jest fails with the error

TypeError: Cannot set property domain of [object process] which has only a getter

The issues seems to come from the package asap used by formidable.

I think that Jest is putting some limitations on the process object since the line where everything breaks is

domain.active = process.domain = null;

in the file raw.js

Does anyone has any workaround or solution for this issue? I cannot migrate to formidable V3 at the moment so that's not an option

0 Answers
Related