node-modules / mm

An simple but flexible mock(or say stub) package, mock mate
Other
158 stars 16 forks source link

res.pipe 时,http mock 无效 #11

Closed alsotang closed 9 years ago

alsotang commented 9 years ago

当使用

http.get('someurl', function (res) {
  res.pipe(someStream);
})

时,mm 的 http mock 无效。

有空再补 test 上来,我先试用一下 nock。

alsotang commented 9 years ago

https://github.com/pgte/nock

dead-horse commented 9 years ago

http mock 好像是有问题, nock 可以解决?

alsotang commented 9 years ago

nock 也对 pipe 无力。我放弃 pipe 了。

现在正在看 https://github.com/substack/stream-handbook ,不过我早就听说 stream 的错误处理很坑了...

alsotang commented 9 years ago

我是在写一个模块 https://github.com/alsotang/simpledownload

dead-horse commented 9 years ago

pipe 有一些隐藏的 Bug,容易踩坑..

fengmk2 commented 9 years ago

当时嫌pipe mock 太麻烦了... 就没做了 — Sent from Mailbox

On Mon, Sep 15, 2014 at 2:54 PM, dead_horse notifications@github.com wrote:

pipe 有一些隐藏的 Bug,容易踩坑..

Reply to this email directly or view it on GitHub: https://github.com/node-modules/mm/issues/11#issuecomment-55557607