Skip to content
Myr

app.all.js

This file

Path

test/app.all.js

35 lines · 721 bytes · JavaScript

Last changed by

tests: add a missing test descriptionIgnacio Carbajobefore adoptionea6e4d3

History of this file

Take it

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

docs: typo fixesDouglas Christopher Wilsonbefore adoption6bc7574

lines 1–21why, one step back
1
2var express = require('../')3 , request = require('supertest');45describe('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 })21

tests: add a missing test descriptionIgnacio Carbajobefore adoptionea6e4d3

line 22why, one step back
22 it('should run the callback for a method just once', function(done){

docs: typo fixesDouglas Christopher Wilsonbefore adoption6bc7574

lines 23–35why, one step back
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})