Skip to content
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

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

dmahajan980
Copy link
Contributor

@dmahajan980 dmahajan980 commented Feb 11, 2020

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.

.travis.yml Outdated

script:
# Run test script
- npm run test
Copy link
Member

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:'));
Copy link
Member

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

Copy link
Member

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

@dmahajan980
Copy link
Contributor Author

@arunans23 I've made the changes as you said. Please check it.

Copy link
Member

@arunans23 arunans23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to run the test both locally and in travis. The last test case seems to be failing.

Screenshot 2020-02-19 at 11 13 44

var mongoose = require('mongoose');

mongoose.connect(process.env.MONGODB_URL, {
useNewUrlParser: true,
Copy link
Member

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?

Copy link
Contributor Author

@dmahajan980 dmahajan980 Feb 19, 2020

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:
warn

@dmahajan980
Copy link
Contributor Author

I tried to run the test both locally and in travis. The last test case seems to be failing.

Screenshot 2020-02-19 at 11 13 44

@arunans23 It is failing because there is an issue with the DELETE /instances/{instancesId} endpoint. It has been opened and is being discussed here.

@arunans23
Copy link
Member

I tried to run the test both locally and in travis. The last test case seems to be failing.
Screenshot 2020-02-19 at 11 13 44

@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

@dmahajan980
Copy link
Contributor Author

dmahajan980 commented Mar 13, 2020

I tried to run the test both locally and in travis. The last test case seems to be failing.
Screenshot 2020-02-19 at 11 13 44

@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?
Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add basic unit tests hooked into Travis CI
2 participants