Skip to content
Myr

req.route.js

This file

Path

test/req.route.js

27 lines · 668 bytes · JavaScript

Last changed by

remove unnecessary test/support/httpJonathan Ongbefore adoption328c6d3

History of this file

Take it

The walk stopped after 200 commits: lines older than a10f695 point at it.

pin jade dev dep so tests do not breakTJ Holowaychukbefore adoptiona10f695

lines 1–2why, one step back
1
2var express = require('../')

remove unnecessary test/support/httpJonathan Ongbefore adoption328c6d3

line 3why, one step back
3 , request = require('supertest');

pin jade dev dep so tests do not breakTJ Holowaychukbefore adoptiona10f695

lines 4–14why, one step back
4
5describe('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.method.should.equal('get');12 req.route.path.should.equal('/user/:id/:op?');13 next();14 });

remove unnecessary test/support/httpJonathan Ongbefore adoption328c6d3

line 15why, one step back
15

pin jade dev dep so tests do not breakTJ Holowaychukbefore adoptiona10f695

lines 16–27why, one step back
16 app.get('/user/:id/edit', function(req, res){
17 req.route.method.should.equal('get');18 req.route.path.should.equal('/user/:id/edit');19 res.end();20 });2122 request(app)23 .get('/user/12/edit')24 .expect(200, done);25 })26 })27})