Loading .jshintrc +7 −6 Original line number Diff line number Diff line Loading @@ -13,11 +13,11 @@ // with different skill levels. "bitwise" : true, // Prohibit bitwise operators (&, |, ^, etc.). "curly" : false, // Require {} for every new block or scope. "curly" : true, // Require {} for every new block or scope. "eqeqeq" : true, // Require triple equals i.e. `===`. "forin" : true, // Tolerate `for in` loops without `hasOwnPrototype`. "immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );` "latedef" : false, // Prohibit variable use before definition. "latedef" : true, // Prohibit variable use before definition. "newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`. "noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`. "noempty" : true, // Prohibit use of empty blocks. Loading @@ -25,7 +25,7 @@ "plusplus" : true, // Prohibit use of `++` & `--`. "regexp" : true, // Prohibit `.` and `[^...]` in regular expressions. "undef" : true, // Require all non-global variables be declared before they are used. "strict" : false, // Require `use strict` pragma in every file. "strict" : true, // Require `use strict` pragma in every file. "trailing" : true, // Prohibit trailing whitespaces. // == Relaxing Options ================================================ Loading @@ -35,7 +35,7 @@ // them only if you are absolutely positive that you know what you are // doing. "asi" : true, // Tolerate Automatic Semicolon Insertion (no semicolons). "asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons). "boss" : false, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments. "debug" : false, // Allow debugger statements e.g. browser breakpoints. "eqnull" : false, // Tolerate use of `== null`. Loading Loading @@ -83,10 +83,11 @@ // Additional globals introduced by Mocha "globals": { "describe" : false, "xdescribe" : false, "it" : false, "xit" : false, "before" : false, "after" : false, "Promise" : true // See: https://github.com/jshint/jshint/issues/1747 "after" : false }, // == JSLint Legacy =================================================== Loading test/request-test.js +6 −4 Original line number Diff line number Diff line 'use strict'; var rp = require('../lib/rp.js'); var http = require('http'); var url = require('url'); Loading @@ -12,7 +14,7 @@ describe('request tests', function () { server = http.createServer(function(request, response){ var path = url.parse(request.url).pathname; var status = parseInt(path.split('/')[1]); if(isNaN(status)) status = 555; if(isNaN(status)) { status = 555; } response.writeHead(status); response.end("Hello world!"); }); Loading @@ -21,7 +23,7 @@ describe('request tests', function () { after(function(){ server.close(); }) }); it('should resolve for 200 status code', function (done) { rp('http://localhost:4000/200') Loading Loading @@ -53,11 +55,11 @@ describe('request tests', function () { it('should reject for http errors', function(done){ rp('http://localhost:1/200') .then(function(){ done(new Error('A failed request should reject, not resolve')) done(new Error('A failed request should reject, not resolve')); }).catch(function(){ done(); }); }) }); describe('simple tests', function(){ Loading Loading
.jshintrc +7 −6 Original line number Diff line number Diff line Loading @@ -13,11 +13,11 @@ // with different skill levels. "bitwise" : true, // Prohibit bitwise operators (&, |, ^, etc.). "curly" : false, // Require {} for every new block or scope. "curly" : true, // Require {} for every new block or scope. "eqeqeq" : true, // Require triple equals i.e. `===`. "forin" : true, // Tolerate `for in` loops without `hasOwnPrototype`. "immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );` "latedef" : false, // Prohibit variable use before definition. "latedef" : true, // Prohibit variable use before definition. "newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`. "noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`. "noempty" : true, // Prohibit use of empty blocks. Loading @@ -25,7 +25,7 @@ "plusplus" : true, // Prohibit use of `++` & `--`. "regexp" : true, // Prohibit `.` and `[^...]` in regular expressions. "undef" : true, // Require all non-global variables be declared before they are used. "strict" : false, // Require `use strict` pragma in every file. "strict" : true, // Require `use strict` pragma in every file. "trailing" : true, // Prohibit trailing whitespaces. // == Relaxing Options ================================================ Loading @@ -35,7 +35,7 @@ // them only if you are absolutely positive that you know what you are // doing. "asi" : true, // Tolerate Automatic Semicolon Insertion (no semicolons). "asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons). "boss" : false, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments. "debug" : false, // Allow debugger statements e.g. browser breakpoints. "eqnull" : false, // Tolerate use of `== null`. Loading Loading @@ -83,10 +83,11 @@ // Additional globals introduced by Mocha "globals": { "describe" : false, "xdescribe" : false, "it" : false, "xit" : false, "before" : false, "after" : false, "Promise" : true // See: https://github.com/jshint/jshint/issues/1747 "after" : false }, // == JSLint Legacy =================================================== Loading
test/request-test.js +6 −4 Original line number Diff line number Diff line 'use strict'; var rp = require('../lib/rp.js'); var http = require('http'); var url = require('url'); Loading @@ -12,7 +14,7 @@ describe('request tests', function () { server = http.createServer(function(request, response){ var path = url.parse(request.url).pathname; var status = parseInt(path.split('/')[1]); if(isNaN(status)) status = 555; if(isNaN(status)) { status = 555; } response.writeHead(status); response.end("Hello world!"); }); Loading @@ -21,7 +23,7 @@ describe('request tests', function () { after(function(){ server.close(); }) }); it('should resolve for 200 status code', function (done) { rp('http://localhost:4000/200') Loading Loading @@ -53,11 +55,11 @@ describe('request tests', function () { it('should reject for http errors', function(done){ rp('http://localhost:1/200') .then(function(){ done(new Error('A failed request should reject, not resolve')) done(new Error('A failed request should reject, not resolve')); }).catch(function(){ done(); }); }) }); describe('simple tests', function(){ Loading