/
githubmirror
/
express
Обзор
Документация
Войти
/
githubmirror
/
express
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/acceptance/params.js
44 строки
1 KB
Owen Luke
examples: fix route in params example
18 май 2017, 04:14
18 май 2017, 04:14
fde8f64
Код
Авторство
О чём код?
var app = require('../../examples/params') var request = require('supertest') describe('params', function(){ describe('GET /', function(){ it('should respond with instructions', function(done){ request(app) .get('/') .expect(/Visit/,done) }) }) describe('GET /user/0', function(){ it('should respond with a user', function(done){ request(app) .get('/user/0') .expect(/user tj/,done) }) }) describe('GET /user/9', function(){ it('should fail to find user', function(done){ request(app) .get('/user/9') .expect(404, /failed to find user/, done) }) }) describe('GET /users/0-2', function(){ it('should respond with three users', function(done){ request(app) .get('/users/0-2') .expect(/users tj, tobi, loki/, done) }) }) describe('GET /users/foo-bar', function(){ it('should fail integer parsing', function(done){ request(app) .get('/users/foo-bar') .expect(400, /failed to parseInt foo/, done) }) }) })