node-mocks-http
Advanced tools
Comparing version 1.5.3 to 1.5.4
@@ -0,1 +1,8 @@ | ||
v 1.5.4 | ||
------- | ||
* Call `write` method from json method of `responseMock` [PR #98][98] | ||
[98]: https://github.com/howardabrams/node-mocks-http/issues/98 | ||
v 1.5.3 | ||
@@ -2,0 +9,0 @@ ------- |
@@ -262,3 +262,3 @@ 'use strict'; | ||
} else { | ||
_data += JSON.stringify(a); | ||
mockResponse.write(JSON.stringify(a), 'utf8'); | ||
} | ||
@@ -270,3 +270,3 @@ } | ||
} else { | ||
_data += JSON.stringify(b); | ||
mockResponse.write(JSON.stringify(b), 'utf8'); | ||
} | ||
@@ -273,0 +273,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"description": "Mock 'http' objects for testing Express routing functions", | ||
"version": "1.5.3", | ||
"version": "1.5.4", | ||
"homepage": "https://github.com/howardabrams/node-mocks-http", | ||
@@ -8,0 +8,0 @@ "bugs": { |
@@ -144,3 +144,3 @@ [![node-mocks-http logo][nmh-logo]][nmh-url] | ||
Merges `createRequest` and `createResponse`. Passes given options object to each | ||
constructor. | ||
constructor. Returns an object with properties `req` and `res`. | ||
@@ -174,15 +174,7 @@ ## Design Decisions | ||
[Most Recent Release Notes][release-notes] | ||
See the [Release History](HISTORY.md) for details. | ||
* [v1.4.4][release-v1.4.4] - June 3, 2015 | ||
* [v1.4.3][release-v1.4.3] - June 3, 2015 | ||
* [v1.4.2][release-v1.4.2] - April 30, 2015 | ||
* [v1.4.1][release-v1.4.1] - April 14, 2015 | ||
* [v1.4.0][release-v1.4.0] - April 12, 2015 | ||
* [v1.3.0][release-v1.3.0] - April 5, 2015 | ||
* [v1.2.7][release-v1.2.7] - March 24, 2015 | ||
* [v1.2.6][release-v1.2.6] - March 19, 2015 | ||
* [v1.2.5][release-v1.2.5] - March 5, 2015 | ||
[release-notes]: https://github.com/howardabrams/node-mocks-http/releases | ||
[release-v1.4.4]: https://github.com/howardabrams/node-mocks-http/releases/tag/v1.4.4 | ||
License | ||
@@ -208,13 +200,1 @@ --- | ||
[node-http-module-url]: http://nodejs.org/docs/latest/api/http.html | ||
[release-notes]: https://github.com/howardabrams/node-mocks-http/releases | ||
[release-v1.4.4]: https://github.com/howardabrams/node-mocks-http/releases/tag/v1.4.4 | ||
[release-v1.4.3]: https://github.com/howardabrams/node-mocks-http/releases/tag/v1.4.3 | ||
[release-v1.4.2]: https://github.com/howardabrams/node-mocks-http/releases/tag/v1.4.2 | ||
[release-v1.4.1]: https://github.com/howardabrams/node-mocks-http/releases/tag/v1.4.1 | ||
[release-v1.4.0]: https://github.com/howardabrams/node-mocks-http/releases/tag/v1.4.0 | ||
[release-v1.3.0]: https://github.com/howardabrams/node-mocks-http/releases/tag/v1.3.0 | ||
[release-v1.2.7]: https://github.com/howardabrams/node-mocks-http/releases/tag/v1.2.7 | ||
[release-v1.2.6]: https://github.com/howardabrams/node-mocks-http/releases/tag/v1.2.6 | ||
[release-v1.2.5]: https://github.com/howardabrams/node-mocks-http/releases/tag/v1.2.5 |
@@ -542,2 +542,14 @@ 'use strict'; | ||
// reference : https://github.com/howardabrams/node-mocks-http/pull/98 | ||
it('should call .write()', function() { | ||
var originalWrite = response.write.bind(response); | ||
var hackedContent = JSON.stringify({foo: 'bar'}); | ||
response.write = function(data, encoding) { | ||
console.log('data :', data); | ||
return originalWrite(hackedContent, encoding); | ||
}; | ||
response.json({hello: 'world'}); | ||
expect(response._getData()).to.eql(hackedContent); | ||
}); | ||
}); | ||
@@ -1096,2 +1108,3 @@ | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2996
137244
198