Skip to content
Myr

app.all.js

This file

Path

test/app.all.js

35 lines · 682 bytes · JavaScript

Last changed by

remove unnecessary test/support/httpJonathan Ongbefore adoption643397e

History of this file

Take 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 back
1
2var express = require('../')

remove unnecessary test/support/httpJonathan Ongbefore adoption643397e

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

expose connect.middleware using Object.getOwnPropertyDescriptor()Jonathan Ongbefore adoption2e68ddb

lines 4–35why, one step back
4
5describe('app.all()', function(){6 it('should add a router per method', function(done){7 var app = express();89 app.all('/tobi', function(req, res){10 res.end(req.method);11 });1213 request(app)14 .put('/tobi')15 .expect('PUT', function(){16 request(app)17 .get('/tobi')18 .expect('GET', done);19 });20 })2122 it('should ', function(done){23 var app = express()24 , n = 0;2526 app.all('/*', function(req, res, next){27 if (n++) return done(new Error('DELETE called several times'));28 next();29 });3031 request(app)32 .del('/tobi')33 .expect(404, done);34 })35})