node-replay icon indicating copy to clipboard operation
node-replay copied to clipboard

not working at all

Open theoephraim opened this issue 9 years ago • 8 comments

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?

theoephraim avatar Jun 09 '15 18:06 theoephraim

+1

Vuuo avatar Sep 03 '15 19:09 Vuuo

@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?

kadamwhite avatar Jan 18 '16 23:01 kadamwhite

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!

theoephraim avatar Jan 18 '16 23:01 theoephraim

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.

oifland avatar Jul 13 '16 16:07 oifland

Still an issue?

djanowski avatar Sep 12 '16 18:09 djanowski

Still an issue. This is what I'm doing:

https://stackoverflow.com/questions/44528163/http-responses-are-not-recorded-when-using-npm-replay-package

laledhanashree avatar Jun 13 '17 17:06 laledhanashree

+1

danturu avatar Jun 22 '17 21:06 danturu

require('supertest') has to come before require('replay'). Are you loading them in the proper order?

ggb667 avatar Nov 09 '18 16:11 ggb667