Skip to content

Commit fcc8032

Browse files
committed
Merge branch 'master' into master
2 parents 4f643d9 + 930e842 commit fcc8032

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@
5555
"nodemon": "^1.8.1"
5656
},
5757
"scripts": {
58-
"dev": "npm run build && bin/dev",
58+
"dev": "npm run build && node bin/dev",
5959
"build": "./node_modules/.bin/babel src/ -d lib/",
6060
"pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.0.8} ./node_modules/.bin/mongodb-runner start",
6161
"test": "cross-env NODE_ENV=test TESTING=1 ./node_modules/.bin/babel-node $COVERAGE_OPTION ./node_modules/jasmine/bin/jasmine.js",
62-
"posttest": "mongodb-runner stop",
62+
"posttest": "./node_modules/.bin/mongodb-runner stop",
6363
"coverage": "cross-env COVERAGE_OPTION='./node_modules/babel-istanbul/lib/cli.js cover -x **/spec/**' npm test",
6464
"start": "node ./bin/parse-server",
6565
"prepublish": "npm run build"

src/index.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -232,15 +232,18 @@ function ParseServer({
232232

233233
api.use(middlewares.handleParseErrors);
234234

235-
process.on('uncaughtException', (err) => {
236-
if( err.code === "EADDRINUSE" ) { // user-friendly message for this common error
237-
console.log(`Unable to listen on port ${err.port}. The port is already in use.`);
238-
process.exit(0);
239-
}
240-
else {
241-
throw err;
242-
}
243-
});
235+
//This causes tests to spew some useless warnings, so disable in test
236+
if (!process.env.TESTING) {
237+
process.on('uncaughtException', (err) => {
238+
if( err.code === "EADDRINUSE" ) { // user-friendly message for this common error
239+
console.log(`Unable to listen on port ${err.port}. The port is already in use.`);
240+
process.exit(0);
241+
}
242+
else {
243+
throw err;
244+
}
245+
});
246+
}
244247
hooksController.load();
245248

246249
return api;

0 commit comments

Comments
 (0)