req.route.js
This file
Path
test/req.route.js
28 lines · 662 bytes · JavaScript
Last changed by
Not known.
History of this fileTake it
The walk stopped after 200 commits: lines older than 2027b87 point at it.
fix(deps): cookie@0.7.0Josh Bukerbefore adoption2027b87
lines 1–28why, one step back1'use strict'23var express = require('../')4 , request = require('supertest');56describe('req', function(){7 describe('.route', function(){8 it('should be the executed Route', function(done){9 var app = express();1011 app.get('/user/:id{/:op}', function(req, res, next){12 res.header('path-1', req.route.path)13 next();14 });1516 app.get('/user/:id/edit', function(req, res){17 res.header('path-2', req.route.path)18 res.end();19 });2021 request(app)22 .get('/user/12/edit')23 .expect('path-1', '/user/:id{/:op}')24 .expect('path-2', '/user/:id/edit')25 .expect(200, done)26 })27 })28})