Skip to content
Myr

app.routes.error.js

This file

Path

test/app.routes.error.js

43 lines · 1.1 KiB · JavaScript

Last changed by

Not known.

History of this file

Take it

The walk stopped after 200 commits: lines older than 6bc7574 point at it.

docs: typo fixesDouglas Christopher Wilsonbefore adoption6bc7574

lines 1–43why, one step back
1var express = require('../')
2 , request = require('supertest');34describe('app', function(){5 describe('.VERB()', function(){6 it('should only call an error handling routing callback when an error is propagated', function(done){7 var app = express();89 var a = false;10 var b = false;11 var c = false;12 var d = false;1314 app.get('/', function(req, res, next){15 next(new Error('fabricated error'));16 }, function(req, res, next) {17 a = true;18 next();19 }, function(err, req, res, next){20 b = true;21 err.message.should.equal('fabricated error');22 next(err);23 }, function(err, req, res, next){24 c = true;25 err.message.should.equal('fabricated error');26 next();27 }, function(err, req, res, next){28 d = true;29 next();30 }, function(req, res){31 a.should.be.false;32 b.should.be.true;33 c.should.be.true;34 d.should.be.false;35 res.send(204);36 });3738 request(app)39 .get('/')40 .expect(204, done);41 })42 })43})