talawa-api
talawa-api copied to clipboard
Resolver: Code Coverage for uploadImage.js
Describe the solution you'd like Implement tests for all mutations that include image uploading
@Laurell876 @palisadoes Sir can I work on this.
Firstly I will create just one test for image upload in user signup, so that you can have a look at my work(if its correct or not) after that I will make tests for other related mutations
Approach would be firstly I will make a test_image folder inside tests folder. I will put a temporary image in that folder for testing purpose.In the test I will use form-data package which will help in creating the body of the request. Then i will read the image using fs package and will send it in the body of request.Does it sound good @Laurell876 and @palisadoes Sir.
@XshubhamX are you still available to work on this?
@palisadoes sir the pull request related to this issue has been merged #225, this issue can be closed.
Re-Opening this issue due to fallen code coverage of the file.
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/helper_functions/uploadImage.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 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/helper_functions/uploadImage.sepc.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.
This issue did not get any activity in the past 60 days and will be closed in 365 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.
https://app.codecov.io/gh/PalisadoesFoundation/talawa-api/blob/develop/src/utilities/uploadImage.ts Completed