request / request-promise

The simplified HTTP request client 'request' with Promise support. Powered by Bluebird.
ISC License
4.77k stars 297 forks source link

Produces warning for jest 25.5.0 #350

Open bogdan opened 4 years ago

bogdan commented 4 years ago

Jest has a new release that forbids overriding of require.cache:

 console.warn
    `require.cache` modification is not permitted

      at Object.notPermittedMethod (node_modules/jest-runtime/build/index.js:1509:44)
      at node_modules/stealthy-require/lib/index.js:24:33
      at forEach (node_modules/stealthy-require/lib/index.js:10:9)
      at clearCache (node_modules/stealthy-require/lib/index.js:22:5)
      at module.exports (node_modules/stealthy-require/lib/index.js:32:5)
      at Object.<anonymous> (node_modules/request-promise/lib/rp.js:10:19)

https://github.com/facebook/jest/pull/9841

I have no idea why request-promise would need such a hack. Is there a workaround to prevent the warning for Jest?