From f29762f4dd5811464684f820286f1c90a694bdff Mon Sep 17 00:00:00 2001 From: Roman Reiss Date: Tue, 19 May 2015 13:00:06 +0200 Subject: 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 --- test/parallel/test-repl-autolibs.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'test/parallel/test-repl-autolibs.js') diff --git a/test/parallel/test-repl-autolibs.js b/test/parallel/test-repl-autolibs.js index c7727f574a..4103a19243 100644 --- a/test/parallel/test-repl-autolibs.js +++ b/test/parallel/test-repl-autolibs.js @@ -1,30 +1,31 @@ +'use strict'; var assert = require('assert'); var util = require('util'); var repl = require('repl'); // A stream to push an array into a REPL function ArrayStream() { - this.run = function (data) { + this.run = function(data) { var self = this; - data.forEach(function (line) { + data.forEach(function(line) { self.emit('data', line + '\n'); }); - } + }; } util.inherits(ArrayStream, require('stream').Stream); ArrayStream.prototype.readable = true; ArrayStream.prototype.writable = true; -ArrayStream.prototype.resume = function () {}; -ArrayStream.prototype.write = function () {}; +ArrayStream.prototype.resume = function() {}; +ArrayStream.prototype.write = function() {}; -var putIn = new ArrayStream; +var putIn = new ArrayStream(); var testMe = repl.start('', putIn, null, true); test1(); -function test1(){ +function test1() { var gotWrite = false; - putIn.write = function (data) { + putIn.write = function(data) { gotWrite = true; if (data.length) { @@ -40,7 +41,7 @@ function test1(){ assert(gotWrite); } -function test2(){ +function test2() { var gotWrite = false; putIn.write = function(data) { gotWrite = true; -- cgit v1.2.3