tests: add test for matching route after error

This commit is contained in:
Douglas Christopher Wilson 2015-07-24 21:36:56 -04:00
parent 2ac2509854
commit de7ffca33f

View File

@ -3,6 +3,22 @@ var express = require('../')
describe('app', function(){
describe('.VERB()', function(){
it('should not get invoked without error handler on error', function(done) {
var app = express();
app.use(function(req, res, next){
next(new Error('boom!'))
});
app.get('/bar', function(req, res){
res.send('hello, world!');
});
request(app)
.post('/bar')
.expect(500, /Error: boom!/, done);
});
it('should only call an error handling routing callback when an error is propagated', function(done){
var app = express();