Skip to content
Myr

deps: cookie@0.5.0

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parent 8880dda · Browse files · 3 files+76 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+76 added−1 removed

  • tests:+72 added−0 removed
  • other:+4 added−1 removed

3 files+76 added−1 removed

modified:test/res.cookie.js+72 added
65 unmodified lines
66 .expect('Set-Cookie', 'name=tobi; Path=/; HttpOnly; Secure')67 .expect(200, done)68 })6970 describe('expires', function () {71 it('should throw on invalid date', function (done) {72 var app = express()7374 app.use(function (req, res) {75 res.cookie('name', 'tobi', { expires: new Date(NaN) })76 res.end()77 })7879 request(app)80 .get('/')81 .expect(500, /option expires is invalid/, done)82 })83 })8485 describe('maxAge', function(){86 it('should set relative expires', function(done){87 var app = express();88
80 unmodified lines
169 .expect(500, /option maxAge is invalid/, done)170 })171 })172173 describe('priority', function () {174 it('should set low priority', function (done) {175 var app = express()176177 app.use(function (req, res) {178 res.cookie('name', 'tobi', { priority: 'low' })179 res.end()180 })181182 request(app)183 .get('/')184 .expect('Set-Cookie', /Priority=Low/)185 .expect(200, done)186 })187188 it('should set medium priority', function (done) {189 var app = express()190191 app.use(function (req, res) {192 res.cookie('name', 'tobi', { priority: 'medium' })193 res.end()194 })195196 request(app)197 .get('/')198 .expect('Set-Cookie', /Priority=Medium/)199 .expect(200, done)200 })201202 it('should set high priority', function (done) {203 var app = express()204205 app.use(function (req, res) {206 res.cookie('name', 'tobi', { priority: 'high' })207 res.end()208 })209210 request(app)211 .get('/')212 .expect('Set-Cookie', /Priority=High/)213 .expect(200, done)214 })215216 it('should throw with invalid priority', function (done) {217 var app = express()218219 app.use(function (req, res) {220 res.cookie('name', 'tobi', { priority: 'foobar' })221 res.end()222 })223224 request(app)225 .get('/')226 .expect(500, /option priority is invalid/, done)227 })228 })229230 describe('signed', function(){231 it('should generate a signed JSON cookie', function(done){232 var app = express();233
47 unmodified lines
modified:History.md+3 added
17 unmodified lines
18 - deps: http-errors@2.0.019 - deps: on-finished@2.4.120 - deps: qs@6.10.321 - deps: raw-body@2.5.122 * deps: cookie@0.5.023 - Add `priority` option24 - Fix `expires` option to reject invalid dates25 * deps: depd@2.0.026 - Replace internal `eval` usage with `Function` constructor27 - Use instance methods on `process` to check for listeners28 * deps: finalhandler@1.2.0
3545 unmodified lines
modified:package.json+1 added-1 removed