Closed miqmago closed 8 years ago
Hey. I'm wagering it's because of the new Mitm
call. Try calling Mitm()
without new
. The function form and instantiation forms are slightly different. The latter doesn't call enable
for you.
Thanks, that was it. The error comes as I copied the example from readme, eslint complains for [eslint] A function with a name starting with an uppercase letter should only be used as a constructor. (new-cap)
so I placed new
as I supposed it was missing in readme :)
Yeah, that lint rule got annoying quick — there are "classes" where calling their constructor as a function implies coercion — String
, Number
et al. If you want, you can rename the Mitm
import to something like intercept
, too, for this.mitm = intercept()
. :)
Hey! thanks for this module. I'm not sure if I'm doing something wrong or it is not supported by
node-mitm
:I'm trying write tests for
node-pushnotifications
, a module that depends onnode-apn
.node-apn
usestls.connect(this.options)
to connect to remote endpoint (see here)So I'm trying to write a test with this code:
I expect to see in console some hoho, hehe, but it seems that nothing of this is happening. Also if I write a
console.log(err)
inendpoint.js
then I see this error:So it seems that is trying to connect to real https://api.sandbox.push.apple.com instead to
mitm
simulated ones. What's going on?