app.all.js
This file
Path
test/app.all.js
38 lines · 790 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–38why, one step back1'use strict'23var after = require('after')4var express = require('../')5 , request = require('supertest');67describe('app.all()', function(){8 it('should add a router per method', function(done){9 var app = express();10 var cb = after(2, done)1112 app.all('/tobi', function(req, res){13 res.end(req.method);14 });1516 request(app)17 .put('/tobi')18 .expect(200, 'PUT', cb)1920 request(app)21 .get('/tobi')22 .expect(200, 'GET', cb)23 })2425 it('should run the callback for a method just once', function(done){26 var app = express()27 , n = 0;2829 app.all('/*splat', function(req, res, next){30 if (n++) return done(new Error('DELETE called several times'));31 next();32 });3334 request(app)35 .del('/tobi')36 .expect(404, done);37 })38})