Skip to content

Commit

Permalink
Re-refixed test with newer node.js versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Mar 31, 2016
1 parent 6a532fe commit 0b58d41
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions test/processImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -804,11 +804,11 @@ describe('express-processimage', function () {
create: run(function () {
var stream = new Stream.Transform();
stream._transform = function (chunk, encoding, callback) {
setImmediate(function () {
setTimeout(function () {
callback(null, chunk);
});
}, 1000);
};
stream.destroy = sinon.spy();
stream.destroy = sinon.spy().named('destroy');
createdStreams.push(stream);
setImmediate(run(function () {
request.abort();
Expand All @@ -832,10 +832,8 @@ describe('express-processimage', function () {
request.once('error', run(function (err) {
expect(err, 'to have message', 'socket hang up');
}));
}).delay(100).then(function () {
expect(createdStreams, 'to satisfy', [
{ destroy: expect.it('was called once') }
]);
}).delay(1).then(function () {
expect(createdStreams[0].destroy, 'was called once');
});
});
});
Expand Down

0 comments on commit 0b58d41

Please sign in to comment.