-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrote tests and Travis CI configuration file and separated mongoose related code into db/mongoose.js #147
base: dev
Are you sure you want to change the base?
Conversation
.travis.yml
Outdated
|
||
script: | ||
# Run test script | ||
- npm run test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New line at the end of the file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix this in all the files
Added some in-line comments
@arunans23 I've made the changes as you said. Please check it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var mongoose = require('mongoose'); | ||
|
||
mongoose.connect(process.env.MONGODB_URL, { | ||
useNewUrlParser: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need these additional properties?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.js
which is now referenced across multiple files and reduces redundant lines of code.