talawa-api
talawa-api copied to clipboard
Resolvers: Create tests for updateUserProfile.js
The Talawa-API code base needs to be 100% reliable. This means we need to have 100% test code coverage.
Tests need to be written for file lib/resolvers/user_mutations/updateUserProfile.js
- We will need the API to be refactored for all methods, classes and/or functions found in this file for testing to be correctly executed.
- When complete, all all methods, classes and/or functions in the refactored file will need to be tested. These tests must be placed in a
single file with the name
tests/resolvers/user_mutations/updateUserProfile.spec.js
. You may need to create the appropriate directory structure to do this.
IMPORTANT:
Please refer to the parent issue on how to implement these tests correctly:
- https://github.com/PalisadoesFoundation/talawa-api/issues/490
PR Acceptance Criteria
- When complete this file must show 100% coverage when merged into the code base. This will be clearly visible when you submit your PR.
- The current code coverage for the file can be found here. If the file isn't found in this directory, or there is a 404 error, then tests have not been created.
- The PR will show a report for the code coverage for the file you have added. You can use that as a guide.
@palisadoes I want to know if this issue is still available, because It seems that most of the test cases have already been written but they are still open as an issue.
We have done many of the tests. Please let me know if any you find that should be closed.
Otherwise feel free to go ahead and work on any that are still valid.
@palisadoes I checked, and there is already a test file for this issue.
I tried to run a test coverage, but i just keep getting these result
@Freedisch the updateUserProfile.js
is having around 30% Code Coverage but expected coverage is 100%
@SiddheshKukade, please, how did you run the test coverage, I'm running it on my machine, and I'm not getting any result
I run npm run test
and I'm getting no result. Did I miss a step?
@Freedisch it's simple use yarn test --coverage
@SiddheshKukade I keep getting the same error whether with npm run test
or yarn test --coverage
· __tests__/resolvers/Query/postsByOrganizationConnection.spec.ts (1) · __tests__/resolvers/Query/organizationsMemberConnection.spec.ts (1) · __tests__/resolvers/Query/postsByOrganization.spec.ts (18) · __tests__/resolvers/Query/posts.spec.ts (18)
It's okay I just fixed it, the bug was from my MongoDB setup. I'm working on the issue
@Freedisch are you still working on this?
If @Freedisch is unavailable pls assign it to me.
100% code coverage has been reached