[Pkg-javascript-commits] [node-mocks-http] 109/296: fixed lint errors in test/*

Thorsten Alteholz alteholz at moszumanska.debian.org
Mon Feb 8 18:13:26 UTC 2016


This is an automated email from the git hooks/post-receive script.

alteholz pushed a commit to branch master
in repository node-mocks-http.

commit 562ef22303cdc7612fb5d3f3242d155eaa54b0c1
Author: Johnny Estilles <johnny.estilles at agentia.asia>
Date:   Wed Mar 11 14:49:02 2015 +0800

    fixed lint errors in test/*
---
 test/test-mockRequest.js  | 20 +++++++++++---------
 test/test-mockResponse.js | 40 +++++++++++++++++++++-------------------
 2 files changed, 32 insertions(+), 28 deletions(-)

diff --git a/test/test-mockRequest.js b/test/test-mockRequest.js
index d6b4fcb..a3861c3 100644
--- a/test/test-mockRequest.js
+++ b/test/test-mockRequest.js
@@ -1,3 +1,5 @@
+'use strict';
+
 /**
  * Test: test-mockRequest
  *
@@ -106,10 +108,10 @@ exports['body - Unset value'] = function(test) {
 
 exports['Object creation - All values set'] = function(test) {
 
-    var methodValue = "PUT";
+    var methodValue = 'PUT';
     var idValue = 34;
     var urlValue = 'http://localhost:6522/blingbling';
-    var usernameValue = "mittens";
+    var usernameValue = 'mittens';
 
     var request = httpMocks.createRequest({
         method: methodValue,
@@ -204,9 +206,9 @@ exports['query object is parsed from url query string'] = function(test) {
         url: 'http://www.whatever.com?a=1&b=2&c=3'
     });
 
-    test.equal(request.query['a'], '1');
-    test.equal(request.query['b'], '2');
-    test.equal(request.query['c'], '3');
+    test.equal(request.query.a, '1');
+    test.equal(request.query.b, '2');
+    test.equal(request.query.c, '3');
 
     test.done();
 };
@@ -221,9 +223,9 @@ exports['query object is parsed from supplied options if provided'] = function(t
         }
     });
 
-    test.equal(request.query['a'], '7');
-    test.equal(request.query['b'], '8');
-    test.equal(request.query['c'], '9');
+    test.equal(request.query.a, '7');
+    test.equal(request.query.b, '8');
+    test.equal(request.query.c, '9');
 
     test.done();
 };
@@ -236,4 +238,4 @@ exports['path(pathname) has to be parsed from url'] = function(test) {
     test.equal(request.path, '/iamthepath');
 
     test.done();
-}
+};
diff --git a/test/test-mockResponse.js b/test/test-mockResponse.js
index 1321bb1..3a93e1b 100644
--- a/test/test-mockResponse.js
+++ b/test/test-mockResponse.js
@@ -1,3 +1,5 @@
+'use strict';
+
 /**
  * Test: test-mockResponse
  *
@@ -10,9 +12,9 @@ var EventEmitter = require('events').EventEmitter;
 exports['object - Simple verification'] = function (test) {
   var response = httpMocks.createResponse();
 
-  response.send("Hello", 'utf8');
-  response.send("World");
-  test.equal("HelloWorld", response._getData());
+  response.send('Hello', 'utf8');
+  response.send('World');
+  test.equal('HelloWorld', response._getData());
   test.ok(response._isUTF8());
   test.ok(!response._isEndCalled());
   test.done();
@@ -21,7 +23,7 @@ exports['object - Simple verification'] = function (test) {
 exports['object - Data Initialization'] = function (test) {
   var response = httpMocks.createResponse();
   test.equal(200, response.statusCode);
-  test.equal("", response._getData());
+  test.equal('', response._getData());
   test.ok(!response._isUTF8());
   test.ok(!response._isEndCalled());
   test.done();
@@ -30,10 +32,10 @@ exports['object - Data Initialization'] = function (test) {
 exports['end - Simple Verification'] = function (test) {
   var response = httpMocks.createResponse();
 
-  response.send("Hello");
-  response.end("World");
+  response.send('Hello');
+  response.end('World');
 
-  test.equal("HelloWorld", response._getData());
+  test.equal('HelloWorld', response._getData());
 
   test.ok(response._isEndCalled());
   test.done();
@@ -42,9 +44,9 @@ exports['end - Simple Verification'] = function (test) {
 exports['end - No Data Called'] = function (test) {
   var response = httpMocks.createResponse();
 
-  response.end("Hello World");
+  response.end('Hello World');
 
-  test.equal("Hello World", response._getData());
+  test.equal('Hello World', response._getData());
 
   test.ok(response._isEndCalled());
   test.done();
@@ -53,10 +55,10 @@ exports['end - No Data Called'] = function (test) {
 exports['write - Simple verification'] = function (test) {
   var response = httpMocks.createResponse();
 
-  response.write("Hello", 'utf8');
-  response.end("World");
+  response.write('Hello', 'utf8');
+  response.end('World');
 
-  test.equal("HelloWorld", response._getData());
+  test.equal('HelloWorld', response._getData());
 
   test.ok(response._isUTF8());
   test.ok(response._isEndCalled());
@@ -197,7 +199,7 @@ exports['cookies - Cookies creation'] = function (test) {
 
 exports['cookies - Cookies assignment'] = function (test) {
   var response = httpMocks.createResponse();
-  response.cookie("egg", "chicken", {
+  response.cookie('egg', 'chicken', {
     maxAge: 1000
   });
   test.deepEqual(response.cookies, {
@@ -213,10 +215,10 @@ exports['cookies - Cookies assignment'] = function (test) {
 
 exports['cookies - Cookie deletion'] = function (test) {
   var response = httpMocks.createResponse();
-  response.cookie("egg", "chicken", {
+  response.cookie('egg', 'chicken', {
     maxAge: 1000
   });
-  response.clearCookie("egg");
+  response.clearCookie('egg');
   test.deepEqual(response.cookies, {});
   test.done();
 };
@@ -359,9 +361,9 @@ exports['events - render'] = function (test) {
 
 
 exports['send - sending response objects a.k.a restifyError with statusCode'] = function(test) {
-  var errors = require('node-restify-errors')
+  var errors = require('node-restify-errors');
   var response = httpMocks.createResponse();
-  response.send(409, new errors.InvalidArgumentError("I just dont like you"));
+  response.send(409, new errors.InvalidArgumentError('I just dont like you'));
 
   test.equal(409, response._getStatusCode());
   test.equal('InvalidArgument', response._getData().code);
@@ -370,9 +372,9 @@ exports['send - sending response objects a.k.a restifyError with statusCode'] =
 };
 
 exports['send - sending response objects a.k.a restifyError without statusCode'] = function(test) {
-  var errors = require('node-restify-errors')
+  var errors = require('node-restify-errors');
   var response = httpMocks.createResponse();
-  response.send(new errors.InvalidArgumentError("I just dont like you"));
+  response.send(new errors.InvalidArgumentError('I just dont like you'));
 
   test.equal(409, response._getStatusCode());
   test.equal('InvalidArgument', response._getData().code);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-mocks-http.git



More information about the Pkg-javascript-commits mailing list