params.js
This file
Path
test/acceptance/params.js
44 lines · 1.0 KiB · JavaScript
Last changed by
Merge tag '3.20.3'Douglas Christopher Wilsonbefore adoption62d5c38
History of this fileTake it
The walk stopped after 200 commits: lines older than 6bc7574 point at it.
examples: make main app file names consistentDouglas Christopher Wilsonbefore adoptionb1d0c19
line 1why, one step back1var app = require('../../examples/params')docs: typo fixesDouglas Christopher Wilsonbefore adoption6bc7574
lines 2–23why, one step back2var request = require('supertest')34describe('params', function(){5 describe('GET /', function(){6 it('should respond with instructions', function(done){7 request(app)8 .get('/')9 .expect(/Visit/,done)10 })11 })1213 describe('GET /user/0', function(){14 it('should respond with a user', function(done){15 request(app)16 .get('/user/0')17 .expect(/user tj/,done)18 })19 })2021 describe('GET /user/9', function(){22 it('should fail to find user', function(done){23 request(app)Merge tag '3.20.3'Douglas Christopher Wilsonbefore adoption62d5c38
lines 24–25why, one step back24 .get('/user/9')25 .expect(404, /failed to find user/, done)docs: typo fixesDouglas Christopher Wilsonbefore adoption6bc7574
lines 26–39why, one step back26 })27 })2829 describe('GET /users/0-2', function(){30 it('should respond with three users', function(done){31 request(app)32 .get('/users/0-2')33 .expect(/users tj, tobi/,done)34 })35 })3637 describe('GET /users/foo-bar', function(){38 it('should fail integer parsing', function(done){39 request(app)Merge tag '3.20.3'Douglas Christopher Wilsonbefore adoption62d5c38
lines 40–41why, one step back40 .get('/users/foo-bar')41 .expect(400, /failed to parseInt foo/, done)docs: typo fixesDouglas Christopher Wilsonbefore adoption6bc7574
lines 42–44why, one step back42 })43 })44})