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>
v7.x
masashi.g 8 years ago
committed by Anna Henningsen
parent
commit
51e24e770a
No known key found for this signature in database GPG Key ID: D8B9F5AEAE84E4CF
  1. 2
      test/parallel/test-stream2-push.js

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

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

Loading…
Cancel
Save