Skip to content
Myr

tests: fix tests that did not bubble errors

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parent bd4fdfe · Browse files · 4 files+37 added−34 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+37 added−34 removed

  • tests:+37 added−34 removed

4 files+37 added−34 removed

modified:test/app.all.js+7 added-5 removed
modified:test/app.head.js+6 added-9 removed
modified:test/app.router.js+18 added-15 removed
634 unmodified lines
635 })636637 it('should work cross-segment', function(done){638 var app = express();639 var cb = after(2, done)640641 app.get('/api*', function(req, res){642 res.send(req.params[0]);643 });644645 request(app)645 .get('/api')646 .expect('', function(){647 request(app)646 .get('/api')647 .expect(200, '', cb)648649 request(app)650 .get('/api/hey')649 .expect('/hey', done);650 });651 .expect(200, '/hey', cb)652 })653654 it('should allow naming', function(done){655 var app = express();
207 unmodified lines
863864 describe('.:name', function(){865 it('should denote a format', function(done){866 var app = express();867 var cb = after(2, done)868869 app.get('/:name.:format', function(req, res){870 res.end(req.params.name + ' as ' + req.params.format);871 });872873 request(app)872 .get('/foo.json')873 .expect('foo as json', function(){874 request(app)874 .get('/foo.json')875 .expect(200, 'foo as json', cb)876877 request(app)878 .get('/foo')876 .expect(404, done);877 });879 .expect(404, cb)880 })881 })882883 describe('.:name?', function(){884 it('should denote an optional format', function(done){885 var app = express();886 var cb = after(2, done)887888 app.get('/:name.:format?', function(req, res){889 res.end(req.params.name + ' as ' + (req.params.format || 'html'));890 });891892 request(app)890 .get('/foo')891 .expect('foo as html', function(){892 request(app)893 .get('/foo')894 .expect(200, 'foo as html', cb)895896 request(app)897 .get('/foo.json')894 .expect('foo as json', done);895 });898 .expect(200, 'foo as json', done)899 })900 })901902 describe('when next() is called', function(){
208 unmodified lines
modified:test/app.use.js+6 added-5 removed
35 unmodified lines
36 it('should support mount-points', function(done){37 var blog = express()38 , forum = express()39 , app = express();40 var cb = after(2, done)4142 blog.get('/', function(req, res){43 res.end('blog');44 });
5 unmodified lines
50 app.use('/blog', blog);51 app.use('/forum', forum);5253 request(app)53 .get('/blog')54 .expect('blog', function(){55 request(app)54 .get('/blog')55 .expect(200, 'blog', cb)5657 request(app)58 .get('/forum')57 .expect('forum', done);58 });59 .expect(200, 'forum', done)60 })6162 it('should set the child\'s .parent', function(){63 var blog = express()
478 unmodified lines