Reputation: 55613
I am using jest/babel-jest to write a node application, am using https
module.
babel.config.js
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current',
},
},
],
],
};
Test file:
import { https } from 'https';
// do some stuff
https.request(...);
But when I run jest I get this:
TypeError: Cannot read property 'request' of undefined
Why won't jest let me make an http request?
I know I'm doing something stupid, I just don't know what :P
Upvotes: 0
Views: 39