diff --git a/test/send.js b/test/send.js index d143c00..51dd3a5 100644 --- a/test/send.js +++ b/test/send.js @@ -178,7 +178,7 @@ describe('send(file).pipe(res)', function () { send(req, req.url, {root: 'test/fixtures'}) .on('stream', function (stream) { // simulate file error - process.nextTick(function () { + stream.on('open', function () { stream.emit('error', new Error('boom!')) }) })