tests: add test for matching route after error
This commit is contained in:
parent
2ac2509854
commit
de7ffca33f
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user