Browse Source

test: change from setTimeout to setImmediate

This is a part of Code And Learn at NodeFest 2016 Challenge

Fixes: https://github.com/nodejs/code-and-learn/issues/58
PR-URL: https://github.com/nodejs/node/pull/9578
Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
v7.x
MURAKAMI Masahiko 8 years ago
committed by Anna Henningsen
parent
commit
58fc7a137c
No known key found for this signature in database GPG Key ID: D8B9F5AEAE84E4CF
  1. 2
      test/parallel/test-stream-unshift-empty-chunk.js

2
test/parallel/test-stream-unshift-empty-chunk.js

@ -11,7 +11,7 @@ var nChunks = 10;
var chunk = Buffer.alloc(10, 'x');
r._read = function(n) {
setTimeout(function() {
setImmediate(function() {
r.push(--nChunks === 0 ? null : chunk);
});
};

Loading…
Cancel
Save