Wrote tests and Travis CI configuration file and separated mongoose related code into db/mongoose.js#147
Wrote tests and Travis CI configuration file and separated mongoose related code into db/mongoose.js#147dmahajan980 wants to merge 3 commits intointermine:devfrom
Conversation
.travis.yml
Outdated
|
|
||
| script: | ||
| # Run test script | ||
| - npm run test No newline at end of file |
There was a problem hiding this comment.
Let's add newline at the end of the file
db/mongoose.js
Outdated
| }); | ||
|
|
||
| var db = mongoose.connection; | ||
| db.on('error', console.error.bind(console, 'MongoDB connection error:')); No newline at end of file |
There was a problem hiding this comment.
New line at the end of the file
There was a problem hiding this comment.
Please fix this in all the files
Added some in-line comments
|
@arunans23 I've made the changes as you said. Please check it. |
| var mongoose = require('mongoose'); | ||
|
|
||
| mongoose.connect(process.env.MONGODB_URL, { | ||
| useNewUrlParser: true, |
There was a problem hiding this comment.
Do we need these additional properties?
There was a problem hiding this comment.
@arunans23 we are using them because the current properties such as the Current URL parser are deprecated and the console will generate the following warnings:

@arunans23 It is failing because there is an issue with the DELETE /instances/{instancesId} endpoint. It has been opened and is being discussed here. |
Great, maybe we can fix that issue first and merge this |
@arunans23 issue #146 has been fixed. So the last test case should not fail now. Would you please review it again? |

Fixes #118
Wrote the tests using Jest and configured to run on Travis CI. Also moved the mongoose related code to
db/mongoose.jswhich is now referenced across multiple files and reduces redundant lines of code.