0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-stream-ispaused.js
isaacs 3e1b1dd4a9 Remove excessive copyright/license boilerplate
The copyright and license notice is already in the LICENSE file.  There
is no justifiable reason to also require that it be included in every
file, since the individual files are not individually distributed except
as part of the entire package.
2015-01-12 15:30:28 -08:00

24 lines
500 B
JavaScript

var assert = require('assert');
var common = require('../common');
var stream = require('stream');
var readable = new stream.Readable;
// _read is a noop, here.
readable._read = Function();
// default state of a stream is not "paused"
assert.ok(!readable.isPaused());
// make the stream start flowing...
readable.on('data', Function());
// still not paused.
assert.ok(!readable.isPaused());
readable.pause();
assert.ok(readable.isPaused());
readable.resume();
assert.ok(!readable.isPaused());