Closed psech closed 9 years ago
Hey,
Thanks for the elaborate report and question. Could it be because you're trying to run it in a browser? Mitm is unfortunately only for Node.js (and Io.js though I've not yet tried it). If you want to hijack browser's XMLHttpRequest requests you could look into http://sinonjs.org or https://www.npmjs.com/package/faux-jax or any similar modules.
Thank you for your answer.
I will do following:
check browserless testing approach (basing on your automated tests :))
That depends on whether you really want to test your JavaScript code that uses Node's net
module or whether you want to test your front-end code. The two libs I mentioned work in the browser because they're for testing front-end code. Mitm.js is, currently at least, only for testing the Node.js side of things. ;-)
investigate possibilities to force browserify to run mitm in browser
That's probably not going to work as browsers don't implement networking the same way as Node.js does.
I'll close this issue as it doesn't have actionable items, but feel free to carry on the conversation. :-) Good luck!
I'm going to have my tests with jasmiene maintained by karma test runner (including browserify adapter).
Test project
My karma config is quite common:
After running
I have got following output: