[fix] Suppress EADDRINUSE errors from test/examples-test.js since we are just looking for require-time errors. Isolate tests to ensure idempotency of ports

This commit is contained in:
indexzero 2012-07-26 04:47:25 -04:00
parent fd648a5290
commit c4a7b15843
2 changed files with 12 additions and 2 deletions

View File

@ -35,8 +35,8 @@
},
"scripts": {
"test": "npm run-script test-http && npm run-script test-https",
"test-http": "vows --spec && vows --spec --target=https",
"test-https": "vows --spec --proxy=https && vows --spec --proxy=https --target=https",
"test-http": "vows --spec -i && vows --spec -i --target=https",
"test-https": "vows --spec -i --proxy=https && vows --spec -i --proxy=https --target=https",
"test-core": "test/core/run"
},
"engines": {

View File

@ -9,6 +9,16 @@ var vows = require('vows')
macros = require('./macros'),
examples = macros.examples;
//
// Suppress `EADDRINUSE` errors since
// we are just checking for require-time errors
//
process.on('uncaughtException', function (err) {
if (err.code !== 'EADDRINUSE') {
throw err;
}
});
vows.describe('node-http-proxy/examples').addBatch(
examples.shouldHaveDeps()
).addBatch(