node-replay
node-replay copied to clipboard
not working at all
I really want to use this module, but it is not working for me at all. Changing the mode does nothing. As soon as it is included, all my requests just time out and do nothing.
- I am using node v0.12.3
- I am making https requests
- I am using mocha and superagent
Trying to do some digging but maybe someone else knows what's up?
+1
@theoephraim Can you give some more specifics of the URLs you are trying to capture—such as the URLs being requested? Have you gotten any errors or tried running DEBUG=replay [your normal command]
, to get more verbose output?
It has been a while since I tried this, so maybe some dependency issues have resolved themselves. I'll try again and see if it works!
Working with @donneler, with DEBUG=replay
, we noticed that only the initial request was going out, but mocha seemed to be killing our test before responses were recorded. We eventually realized that async unit tests (e.g. HTTP requests) need a "done" callback so that mocha knows when they are done. See Asynchronous Unit Tests With Mocha, Promises, And WinJS for a great explanation.
Prior to using DEBUG=replay
, the challenge was that we didn't see any output when running in record mode - nothing on the console and nothing recorded to fixtures/
so it almost looked like replay was doing nothing.
Still an issue?
Still an issue. This is what I'm doing:
https://stackoverflow.com/questions/44528163/http-responses-are-not-recorded-when-using-npm-replay-package
+1
require('supertest') has to come before require('replay'). Are you loading them in the proper order?