Skip to content

Commit c4a7b15

Browse files
committed
[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
1 parent fd648a5 commit c4a7b15

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
},
3636
"scripts": {
3737
"test": "npm run-script test-http && npm run-script test-https",
38-
"test-http": "vows --spec && vows --spec --target=https",
39-
"test-https": "vows --spec --proxy=https && vows --spec --proxy=https --target=https",
38+
"test-http": "vows --spec -i && vows --spec -i --target=https",
39+
"test-https": "vows --spec -i --proxy=https && vows --spec -i --proxy=https --target=https",
4040
"test-core": "test/core/run"
4141
},
4242
"engines": {

test/examples-test.js

+10
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ var vows = require('vows')
99
macros = require('./macros'),
1010
examples = macros.examples;
1111

12+
//
13+
// Suppress `EADDRINUSE` errors since
14+
// we are just checking for require-time errors
15+
//
16+
process.on('uncaughtException', function (err) {
17+
if (err.code !== 'EADDRINUSE') {
18+
throw err;
19+
}
20+
});
21+
1222
vows.describe('node-http-proxy/examples').addBatch(
1323
examples.shouldHaveDeps()
1424
).addBatch(

0 commit comments

Comments
 (0)