File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 59
59
"build" : " ./node_modules/.bin/babel src/ -d lib/" ,
60
60
"pretest" : " cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.0.8} ./node_modules/.bin/mongodb-runner start" ,
61
61
"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" ,
63
63
"coverage" : " cross-env COVERAGE_OPTION='./node_modules/babel-istanbul/lib/cli.js cover -x **/spec/**' npm test" ,
64
64
"start" : " node ./bin/parse-server" ,
65
65
"prepublish" : " npm run build"
Original file line number Diff line number Diff line change @@ -232,15 +232,18 @@ function ParseServer({
232
232
233
233
api . use ( middlewares . handleParseErrors ) ;
234
234
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
+ }
244
247
hooksController . load ( ) ;
245
248
246
249
return api ;
You can’t perform that action at this time.
0 commit comments