[Pkg-javascript-commits] [node-mocks-http] 53/296: Adding test for reverse status code support

Thorsten Alteholz alteholz at moszumanska.debian.org
Mon Feb 8 18:13:20 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 16412088191cc4823fa08595020e563e2d21598d
Author: Ryan Knell <ryan.knell at gmail.com>
Date:   Wed Oct 15 16:00:43 2014 +1000

    Adding test for reverse status code support
---
 test/test-mockResponse.js | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/test/test-mockResponse.js b/test/test-mockResponse.js
index e60b42f..4be2940 100644
--- a/test/test-mockResponse.js
+++ b/test/test-mockResponse.js
@@ -272,6 +272,19 @@ exports['json - With status code'] = function (test) {
   test.done();
 };
 
+exports['json - With status code reverse'] = function (test) {
+  var response = httpMocks.createResponse(),
+      data = {
+          hello: 'there'
+      };
+
+  response.json(data, 201);
+  test.equal(response._isJSON(), true);
+  test.equal(response._getData(), JSON.stringify(data));
+  test.equal(response.statusCode, 201);
+  test.done();
+};
+
 exports['events - end'] = function (test) {
   var response = httpMocks.createResponse({
     eventEmitter: EventEmitter

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