From c4a7b1584302fe12a8fc06b6774db5ff602c3607 Mon Sep 17 00:00:00 2001 From: indexzero Date: Thu, 26 Jul 2012 04:47:25 -0400 Subject: [PATCH] [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 --- package.json | 4 ++-- test/examples-test.js | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e3e4c90..2e1496e 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/test/examples-test.js b/test/examples-test.js index 472fc8a..36beb89 100644 --- a/test/examples-test.js +++ b/test/examples-test.js @@ -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(