Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream support #54

Open
austinkelleher opened this issue Feb 19, 2017 · 2 comments
Open

Stream support #54

austinkelleher opened this issue Feb 19, 2017 · 2 comments

Comments

@austinkelleher
Copy link

austinkelleher commented Feb 19, 2017

I want to mock a superagent request that creates pipes the data to a write stream e.g.

const targz = require('tar.gz2');
const request = require('superagent');

const tarball = 'some-file.tgz';
const read = request.get(tarball);
const write = targz().createWriteStream(dir);

const stream = read.pipe(write).on('finish', doSomething);
@fdubost
Copy link
Member

fdubost commented Feb 20, 2017

Unfortunately superagent-mock doesn't support this feature for now... But if you want, you can propose a PR 😉

@DevSide
Copy link
Contributor

DevSide commented May 25, 2017

It doesn't look like too hard. It is only a node feature. https://github.com/visionmedia/superagent/blob/master/lib/node/index.js

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

No branches or pull requests

3 participants