/
githubmirror
/
express
Обзор
Документация
Войти
/
githubmirror
/
express
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
4.17.2
test/app.all.js
34 строки
721 B
Ignacio Carbajo
tests: add a missing test description
02 май 2015, 05:12
02 май 2015, 05:12
ea6e4d3
Код
Авторство
О чём код?
var express = require('../') , request = require('supertest'); describe('app.all()', function(){ it('should add a router per method', function(done){ var app = express(); app.all('/tobi', function(req, res){ res.end(req.method); }); request(app) .put('/tobi') .expect('PUT', function(){ request(app) .get('/tobi') .expect('GET', done); }); }) it('should run the callback for a method just once', function(done){ var app = express() , n = 0; app.all('/*', function(req, res, next){ if (n++) return done(new Error('DELETE called several times')); next(); }); request(app) .del('/tobi') .expect(404, done); }) })