req.get.js
This file
Path
test/req.get.js
35 lines · 836 bytes · JavaScript
Last changed by
updated tests to use "supertest"TJ Holowaychukbefore adoption0f5560e
History of this fileTake it
The walk stopped after 200 commits: lines older than 2c14d0c point at it.
clean up weird whitespace in error-pages acceptance testsTJ Holowaychukbefore adoption2c14d0c
lines 1–2why, one step back12var express = require('../')assertion for req.get() => undefined. Closes #1152TJ Holowaychukbefore adoption685eec0
lines 3–4why, one step back3 , request = require('./support/http')4 , assert = require('assert');clean up weird whitespace in error-pages acceptance testsTJ Holowaychukbefore adoption2c14d0c
lines 5–11why, one step back56describe('req', function(){7 describe('.get(field)', function(){8 it('should return the header field value', function(done){9 var app = express();1011 app.use(function(req, res){assertion for req.get() => undefined. Closes #1152TJ Holowaychukbefore adoption685eec0
line 12why, one step back12 assert(req.get('Something-Else') === undefined);clean up weird whitespace in error-pages acceptance testsTJ Holowaychukbefore adoption2c14d0c
lines 13–18why, one step back13 res.end(req.get('Content-Type'));14 });1516 request(app)17 .post('/')18 .set('Content-Type', 'application/json')updated tests to use "supertest"TJ Holowaychukbefore adoption0f5560e
line 19why, one step back19 .expect('application/json', done);clean up weird whitespace in error-pages acceptance testsTJ Holowaychukbefore adoption2c14d0c
lines 20–31why, one step back20 })2122 it('should special-case Referer', function(done){23 var app = express();2425 app.use(function(req, res){26 res.end(req.get('Referer'));27 });2829 request(app)30 .post('/')31 .set('Referrer', 'http://foobar.com')updated tests to use "supertest"TJ Holowaychukbefore adoption0f5560e
line 32why, one step back32 .expect('http://foobar.com', done);clean up weird whitespace in error-pages acceptance testsTJ Holowaychukbefore adoption2c14d0c
lines 33–35why, one step back33 })34 })35})