We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f3d99a4 commit fcd4d76Copy full SHA for fcd4d76
test/res.cookie.js
@@ -150,6 +150,28 @@ describe('res', function(){
150
})
151
152
153
+ describe('signed without secret', function(){
154
+ it('should throw an error', function(done){
155
+ var app = express();
156
+
157
+ app.use(cookieParser());
158
159
+ app.use(function(req, res){
160
+ try {
161
+ res.cookie('name', 'tobi', { signed: true });
162
+ } catch (err) {
163
+ return res.json({ status: 'OK' });
164
+ }
165
166
+ res.json({ status: 'FAIL' });
167
+ });
168
169
+ request(app)
170
+ .get('/')
171
+ .expect({ status: 'OK' }, done);
172
+ })
173
174
175
describe('.signedCookie(name, string)', function(){
176
it('should set a signed cookie', function(done){
177
var app = express();
0 commit comments