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>
This commit is contained in:
MURAKAMI Masahiko authored and Myles Borins committed 2016-12-20 16:03:59 -05:00
1 parent eca12d4316
commit b87fe250d2
1 file changed
+1 -1
@@ -12,7 +12,7 @@ var chunk = new Buffer(10);
chunk.fill('x');
r._read = function(n) {
setTimeout(function() {
setImmediate(function() {
r.push(--nChunks === 0 ? null : chunk);
});
};