[Pkg-javascript-commits] [node-mocks-http] 263/296: Merge pull request #71 from aaronjameslang/issue-70-auto-populate-url

Thorsten Alteholz alteholz at moszumanska.debian.org
Mon Feb 8 18:13:43 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 b6ea7f2ed2e36e38cfca423e100f8a0eb6805fc4
Merge: 9acc2b6 2de41e7
Author: Howard Abrams <howardabrams at users.noreply.github.com>
Date:   Mon Sep 21 14:43:29 2015 -0700

    Merge pull request #71 from aaronjameslang/issue-70-auto-populate-url
    
    Issue 70 auto populate url

 lib/mockRequest.js           |  2 +-
 test/lib/mockRequest.spec.js | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --cc lib/mockRequest.js
index 2ba2c5e,e008d95..65a214e
--- a/lib/mockRequest.js
+++ b/lib/mockRequest.js
@@@ -51,10 -50,9 +51,10 @@@ function createRequest(options) 
      var mockRequest = {};
  
      mockRequest.method = (options.method) ? options.method : 'GET';
-     mockRequest.url = (options.url) ? options.url : '';
+     mockRequest.url = options.url || options.path || '';
      mockRequest.originalUrl = options.originalUrl || mockRequest.url;
 -    mockRequest.path = (options.url) ? url.parse(options.url).pathname : '';
 +    mockRequest.path = options.path ||
 +        (( (options.url) ? url.parse(options.url).pathname : '' ));
      mockRequest.params = (options.params) ? options.params : {};
      if (options.session) {
          mockRequest.session = options.session;

-- 
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