res.clearCookie.js — express Source File
Architecture documentation for res.clearCookie.js, a javascript file in the express codebase.
Entity Profile
Source Code
'use strict'
var express = require('../')
, request = require('supertest');
describe('res', function(){
describe('.clearCookie(name)', function(){
it('should set a cookie passed expiry', function(done){
var app = express();
app.use(function(req, res){
res.clearCookie('sid').end();
});
request(app)
.get('/')
.expect('Set-Cookie', 'sid=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT')
.expect(200, done)
})
})
describe('.clearCookie(name, options)', function(){
it('should set the given params', function(done){
var app = express();
app.use(function(req, res){
res.clearCookie('sid', { path: '/admin' }).end();
});
request(app)
.get('/')
.expect('Set-Cookie', 'sid=; Path=/admin; Expires=Thu, 01 Jan 1970 00:00:00 GMT')
.expect(200, done)
})
it('should ignore maxAge', function(done){
var app = express();
app.use(function(req, res){
res.clearCookie('sid', { path: '/admin', maxAge: 1000 }).end();
});
request(app)
.get('/')
.expect('Set-Cookie', 'sid=; Path=/admin; Expires=Thu, 01 Jan 1970 00:00:00 GMT')
.expect(200, done)
})
it('should ignore user supplied expires param', function(done){
var app = express();
app.use(function(req, res){
res.clearCookie('sid', { path: '/admin', expires: new Date() }).end();
});
request(app)
.get('/')
.expect('Set-Cookie', 'sid=; Path=/admin; Expires=Thu, 01 Jan 1970 00:00:00 GMT')
.expect(200, done)
})
})
})
Source
Frequently Asked Questions
What does res.clearCookie.js do?
res.clearCookie.js is a source file in the express codebase, written in javascript.
Where is res.clearCookie.js in the architecture?
res.clearCookie.js is located at test/res.clearCookie.js (directory: test).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free