Skip to content

Commit bcaa81d

Browse files
committed
Added test cases for Auth section.
1 parent 6b4411e commit bcaa81d

File tree

6 files changed

+929
-5
lines changed

6 files changed

+929
-5
lines changed

app.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ var cors = require('cors');
1212
var MONGODB_URL = process.env.MONGODB_URL;
1313
var mongoose = require('mongoose');
1414
mongoose.connect(MONGODB_URL, { useNewUrlParser: true }).then(() => {
15-
console.log("Connected to %s", MONGODB_URL);
16-
console.log("App is running ... \n");
17-
console.log("Press CTRL + C to stop the process. \n");
15+
//don't show the log when it is test
16+
if(process.env.NODE_ENV !== 'test') {
17+
console.log("Connected to %s", MONGODB_URL);
18+
console.log("App is running ... \n");
19+
console.log("Press CTRL + C to stop the process. \n");
20+
}
1821
})
1922
.catch(err => {
2023
console.error("App starting error:", err.message);
@@ -24,7 +27,10 @@ var db = mongoose.connection;
2427

2528
var app = express();
2629

27-
app.use(logger('dev'));
30+
//don't show the log when it is test
31+
if(process.env.NODE_ENV !== 'test') {
32+
app.use(logger('dev'));
33+
}
2834
app.use(express.json());
2935
app.use(express.urlencoded({ extended: false }));
3036
app.use(cookieParser());

0 commit comments

Comments
 (0)