-
-
Notifications
You must be signed in to change notification settings - Fork 878
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
Create all API Resolver Tests #490
Comments
github-actions
bot
added
parent
Parent issue
test
Testing application
unapproved
Unapproved for Pull Request
labels
Feb 24, 2022
This was referenced Feb 24, 2022
This was referenced Feb 8, 2024
This was referenced Mar 1, 2024
This was referenced Apr 9, 2024
This was referenced Apr 16, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The Talawa-API code base needs to be 100% reliable. This means we need 100% test code coverage.
Our resolver test suite must cover all resolvers and function correctly.
This is a parent issue for resolver tests:
API Resolver File Template
The API resolver file will need to be refactored using these guidelines
API Function
This is the part of the file's code that accesses backend systems such as object storage and data storage. We require this code to have dedicated functions.
The function must:
Perform a single resolver task based on user input parameters
Perform a database or object storage call
Delegate calculation, sorting, data structuring or usage of external packages to a separate non-API function in the same file.
Response creator function if a particular unit task needs to be performed for some sort of structuring
Return a response
Note: You must ensure that if the API fails in any of the function's steps that all the previously executed database calls in the function are reversed.
Unit Function
This is the part of the file's code that does not access backend systems at all. We require this code to have dedicated functions.
The function must:
Other
It is possible that you may need to combine unit functions and database calls together to get the desired functionality. This is OK, however for make sure these functions mostly contain only unit functions. These combined functions must be tested also.
API Resolver Test File Template
Utilise the unit function to your test code to get the results and check the response.
Child Issues:
The text was updated successfully, but these errors were encountered: