Files: 65191f9a9664f013ebe726bb95a1a54b086e1bd5 / test / test-79-npm / errorhandler / errorhandler.js
376 bytesRaw
1 | ; |
2 | |
3 | var errorhandler = require('errorhandler'); |
4 | var noop = function () {}; |
5 | var req = { headers: { Accept: 'text/html' } }; |
6 | var res = { setHeader: noop, end: noop }; |
7 | |
8 | var middleware = errorhandler(); |
9 | var wasCalled = false; |
10 | |
11 | middleware('Message', req, res, function () { |
12 | wasCalled = true; |
13 | }); |
14 | |
15 | setTimeout(function () { |
16 | if (!wasCalled) console.log('ok'); |
17 | }, 200); |
18 |
Built with git-ssb-web