node-mocks-http
Advanced tools
Comparing version 1.7.5 to 1.7.6
@@ -0,1 +1,8 @@ | ||
v 1.7.6 | ||
------- | ||
- Fix for [Issue #182][182]. | ||
[182]: https://github.com/howardabrams/node-mocks-http/issues/182 | ||
v 1.7.5 | ||
@@ -2,0 +9,0 @@ ------- |
@@ -263,4 +263,8 @@ 'use strict'; | ||
if (typeof a !== 'undefined') { | ||
if (typeof a === 'number') { | ||
if (typeof a === 'number' && typeof b !== 'undefined') { | ||
mockResponse.statusCode = a; | ||
mockResponse.write(JSON.stringify(b), 'utf8'); | ||
} else if(typeof b !== 'undefined' && typeof b === 'number') { | ||
mockResponse.statusCode = b; | ||
mockResponse.write(JSON.stringify(a), 'utf8'); | ||
} else { | ||
@@ -270,10 +274,2 @@ mockResponse.write(JSON.stringify(a), 'utf8'); | ||
} | ||
if (typeof b !== 'undefined') { | ||
if (typeof b === 'number') { | ||
mockResponse.statusCode = b; | ||
} else { | ||
mockResponse.write(JSON.stringify(b), 'utf8'); | ||
} | ||
} | ||
mockResponse.emit('send'); | ||
@@ -301,6 +297,9 @@ mockResponse.end(); | ||
mockResponse.setHeader('Content-Type', 'text/javascript'); | ||
if (typeof a !== 'undefined') { | ||
if (typeof a === 'number') { | ||
if (typeof a === 'number' && typeof b !== 'undefined') { | ||
mockResponse.statusCode = a; | ||
_data += JSON.stringify(b); | ||
} else if(typeof b !== 'undefined' && typeof b === 'number') { | ||
mockResponse.statusCode = b; | ||
_data += JSON.stringify(a); | ||
} else { | ||
@@ -310,10 +309,2 @@ _data += JSON.stringify(a); | ||
} | ||
if (typeof b !== 'undefined') { | ||
if (typeof b === 'number') { | ||
mockResponse.statusCode = b; | ||
} else { | ||
_data += JSON.stringify(b); | ||
} | ||
} | ||
mockResponse.emit('send'); | ||
@@ -320,0 +311,0 @@ mockResponse.end(); |
@@ -5,3 +5,3 @@ { | ||
"description": "Mock 'http' objects for testing Express routing functions", | ||
"version": "1.7.5", | ||
"version": "1.7.6", | ||
"homepage": "https://github.com/howardabrams/node-mocks-http", | ||
@@ -45,3 +45,3 @@ "bugs": { | ||
"dependencies": { | ||
"accepts": "^1.3.5", | ||
"accepts": "^1.3.7", | ||
"depd": "^1.1.0", | ||
@@ -52,11 +52,11 @@ "fresh": "^0.5.2", | ||
"mime": "^1.3.4", | ||
"parseurl": "^1.3.1", | ||
"parseurl": "^1.3.3", | ||
"range-parser": "^1.2.0", | ||
"type-is": "^1.6.16" | ||
"type-is": "^1.6.18" | ||
}, | ||
"devDependencies": { | ||
"@types/express": "^4.16.0", | ||
"@types/express": "^4.16.1", | ||
"chai": "^3.5.0", | ||
"eslint": "^5.16.0", | ||
"gulp": "^4.0.0", | ||
"gulp": "^4.0.1", | ||
"gulp-eslint": "^5.0.0", | ||
@@ -63,0 +63,0 @@ "gulp-istanbul": "^1.1.1", |
72572
1713
Updatedaccepts@^1.3.7
Updatedparseurl@^1.3.3
Updatedtype-is@^1.6.18