[Pkg-javascript-commits] [node-mocks-http] 143/296: added; mockRequest - ability to set signed cookies via `._setSignedCookiesVariable()`
Thorsten Alteholz
alteholz at moszumanska.debian.org
Mon Feb 8 18:13:30 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 d7d8435630327121e87d7f785b722053f6db3d6e
Author: Johnny Estilles <johnny.estilles at agentia.asia>
Date: Tue Mar 24 12:30:51 2015 +0800
added; mockRequest - ability to set signed cookies via `._setSignedCookiesVariable()`
---
lib/mockRequest.js | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/lib/mockRequest.js b/lib/mockRequest.js
index 347c7cc..f992fce 100644
--- a/lib/mockRequest.js
+++ b/lib/mockRequest.js
@@ -157,6 +157,19 @@ function createRequest(options) {
};
/**
+ * Sets a variable that is stored in the signed cookies.
+ *
+ * @param variable The variable to store in the signed cookies
+ * @param value The value associated with the variable
+ */
+ mockRequest._setSignedCookiesVariable = function(variable, value) {
+ if (typeof mockRequest.signedCookies !== 'object') {
+ mockRequest.signedCookies = {};
+ }
+ mockRequest.signedCookies[variable] = value;
+ };
+
+ /**
* Sets a variable that is stored in the headers.
*
* @param variable The variable to store in the headers
--
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