summaryrefslogtreecommitdiff
path: root/test/parallel/test-stream2-unpipe-drain.js
diff options
context:
space:
mode:
authorRoman Reiss <me@silverwind.io>2015-05-19 13:00:06 +0200
committerRoman Reiss <me@silverwind.io>2015-05-19 21:21:27 +0200
commitf29762f4dd5811464684f820286f1c90a694bdff (patch)
tree67ba73a81c3938f41796dfa4c595f9713de59933 /test/parallel/test-stream2-unpipe-drain.js
parent85d99830096a48b7d50cc3b0e5c3fba4172c2d02 (diff)
downloadandroid-node-v8-f29762f4dd5811464684f820286f1c90a694bdff.tar.gz
android-node-v8-f29762f4dd5811464684f820286f1c90a694bdff.tar.bz2
android-node-v8-f29762f4dd5811464684f820286f1c90a694bdff.zip
test: enable linting for tests
Enable linting for the test directory. A number of changes was made so all tests conform the current rules used by lib and src directories. The only exception for tests is that unreachable (dead) code is allowed. test-fs-non-number-arguments-throw had to be excluded from the changes because of a weird issue on Windows CI. PR-URL: https://github.com/nodejs/io.js/pull/1721 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'test/parallel/test-stream2-unpipe-drain.js')
-rw-r--r--test/parallel/test-stream2-unpipe-drain.js21
1 files changed, 11 insertions, 10 deletions
diff --git a/test/parallel/test-stream2-unpipe-drain.js b/test/parallel/test-stream2-unpipe-drain.js
index 12d1c0648d..a430e4a58d 100644
--- a/test/parallel/test-stream2-unpipe-drain.js
+++ b/test/parallel/test-stream2-unpipe-drain.js
@@ -1,3 +1,4 @@
+'use strict';
var common = require('../common');
var assert = require('assert');
var stream = require('stream');
@@ -11,11 +12,11 @@ var crypto = require('crypto');
var util = require('util');
function TestWriter() {
- stream.Writable.call(this);
+ stream.Writable.call(this);
}
util.inherits(TestWriter, stream.Writable);
-TestWriter.prototype._write = function (buffer, encoding, callback) {
+TestWriter.prototype._write = function(buffer, encoding, callback) {
console.log('write called');
// super slow write stream (callback never called)
};
@@ -23,12 +24,12 @@ TestWriter.prototype._write = function (buffer, encoding, callback) {
var dest = new TestWriter();
function TestReader(id) {
- stream.Readable.call(this);
- this.reads = 0;
+ stream.Readable.call(this);
+ this.reads = 0;
}
util.inherits(TestReader, stream.Readable);
-TestReader.prototype._read = function (size) {
+TestReader.prototype._read = function(size) {
this.reads += 1;
this.push(crypto.randomBytes(size));
};
@@ -38,13 +39,13 @@ var src2 = new TestReader();
src1.pipe(dest);
-src1.once('readable', function () {
- process.nextTick(function () {
+src1.once('readable', function() {
+ process.nextTick(function() {
src2.pipe(dest);
- src2.once('readable', function () {
- process.nextTick(function () {
+ src2.once('readable', function() {
+ process.nextTick(function() {
src1.unpipe(dest);
});
@@ -53,7 +54,7 @@ src1.once('readable', function () {
});
-process.on('exit', function () {
+process.on('exit', function() {
assert.equal(src1.reads, 2);
assert.equal(src2.reads, 2);
});