Browse Source

test: use setImmediate() in test of stream2

use setImmediate() insted of setTimeout()
 in test of stream2 push.
The test is in test/parallel/test-stream2-push.js

Fixes: https://github.com/nodejs/code-and-learn/issues/58
PR-URL: https://github.com/nodejs/node/pull/9583
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
v6
masashi.g 8 years ago
committed by Shigeki Ohtsu
parent
commit
99277952b4
  1. 2
      test/parallel/test-stream2-push.js

2
test/parallel/test-stream2-push.js

@ -111,7 +111,7 @@ function end() {
source.emit('end');
assert(!reading);
writer.end(stream.read());
setTimeout(function() {
setImmediate(function() {
assert(ended);
});
}

Loading…
Cancel
Save