Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Correctly catch exception in http test #1475
From this (doesn't exit):
$ grunt nodeunit:all Running "nodeunit:all" (nodeunit) task Testing http.js...........(node:89954) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 6): Error: connect ENOENT ./wrong.sock (node:89954) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
$ grunt nodeunit:all Running "nodeunit:all" (nodeunit) task Testing http.js...........F.......... >> testSocket >> Error: connect ENOENT ./wrong.sock >> at Object._errnoException (util.js:1024:11) >> at _exceptionWithHostPort (util.js:1046:20) >> at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1182:14) Warning: 1/29 assertions failed (656ms) Use --force to continue. Aborted due to warnings.
Test it locally by changing this line in test
socketPath: './test.sock', // change to e.g. socketPath: './wrong.sock',
Wanted to fix this after it caused trouble to figure out why a test was failing in another PR.