req.route.js
This file
Path
test/req.route.js
25 lines · 576 bytes · JavaScript
Last changed by
remove unnecessary test/support/httpJonathan Ongbefore adoption643397e
History of this fileTake it
The walk stopped after 200 commits: lines older than 2e68ddb point at it.
expose connect.middleware using Object.getOwnPropertyDescriptor()Jonathan Ongbefore adoption2e68ddb
lines 1–2why, one step back12var express = require('../')remove unnecessary test/support/httpJonathan Ongbefore adoption643397e
line 3why, one step back3 , request = require('supertest');expose connect.middleware using Object.getOwnPropertyDescriptor()Jonathan Ongbefore adoption2e68ddb
lines 4–13why, one step back45describe('req', function(){6 describe('.route', function(){7 it('should be the executed Route', function(done){8 var app = express();910 app.get('/user/:id/:op?', function(req, res, next){11 req.route.path.should.equal('/user/:id/:op?');12 next();13 });remove unnecessary test/support/httpJonathan Ongbefore adoption643397e
line 14why, one step back14expose connect.middleware using Object.getOwnPropertyDescriptor()Jonathan Ongbefore adoption2e68ddb
lines 15–25why, one step back15 app.get('/user/:id/edit', function(req, res){16 req.route.path.should.equal('/user/:id/edit');17 res.end();18 });1920 request(app)21 .get('/user/12/edit')22 .expect(200, done);23 })24 })25})