Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

Recording does not work with Wreck #118

Open
abhagupta opened this issue Aug 14, 2016 · 0 comments
Open

Recording does not work with Wreck #118

abhagupta opened this issue Aug 14, 2016 · 0 comments

Comments

@abhagupta
Copy link

Hi @assaf . Thanks for making this module. This is something I was looking for a long time. But I am trying to use it with wreck npm module (another popular HTTP request module) and the recording does not work. Wondering if you have any ideas? Below is my code:

const Wreck = require('wreck');
const replay = require('replay');
var callback = function(err, response, payload){
    console.log(err);
    console.log(payload); // converting the buffer to a string and logging
};
Wreck.get('https://www.example.com', callback);

The error is :

bash-3.2$ REPLAY=record node test.js 
{ Error: Payload stream closed prematurely
    at ProxyResponse.onResClose (/mocks/experiments/wreck_replay/node_modules/wreck/lib/index.js:383:32)
    at ProxyResponse.g (events.js:286:16)
    at emitNone (events.js:86:13)
    at ProxyResponse.emit (events.js:185:7)
    at ProxyResponse.<anonymous> (mocks/experiments/wreck_replay/node_modules/replay/lib/replay/proxy.js:163:22)
    at ProxyResponse.g (events.js:286:16)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant