[Pkg-javascript-commits] [node-mocks-http] 62/296: add uni test for json/status chain.

Thorsten Alteholz alteholz at moszumanska.debian.org
Mon Feb 8 18:13:21 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 b95261ff3285f9fc703c17ee8434b4d96215df1d
Author: Sebastien Guimont <sebastieng at sympatico.ca>
Date:   Tue Jan 6 13:11:31 2015 -0500

    add uni test for json/status chain.
---
 test/test-mockResponse.js | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/test/test-mockResponse.js b/test/test-mockResponse.js
index 4be2940..5a83b0a 100644
--- a/test/test-mockResponse.js
+++ b/test/test-mockResponse.js
@@ -285,6 +285,18 @@ exports['json - With status code reverse'] = function (test) {
   test.done();
 };
 
+exports['json - With status code - chain'] = function (test) {
+  var response = httpMocks.createResponse(),
+      data = {
+        hello: 'there'
+      };
+  response.status(201).json(data);
+  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