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

Test APIs #48

Merged
merged 12 commits into from
Dec 4, 2022
Merged

Test APIs #48

merged 12 commits into from
Dec 4, 2022

Conversation

Abhiek187
Copy link
Owner

@Abhiek187 Abhiek187 commented Dec 4, 2022

To help remediate issues like #47, I added tests that call the spoonacular API to make sure the responses are valid. There are 5 API tests, where the random endpoint uses 1.06 points each and the recipe ID endpoint uses 1.1 points each. So in total, each npm test command uses 1.06(2) + 1.1(3) = 2.12 + 3.3 = 5.42 points. With 4 workflows, that totals 5.42(4) = 21.68 points out of the 150 I have under the free plan, which is a little tight, but manageable (no more than 6 attempts per day).

As expected, most of the API tests failed since the binary string doesn't conform to the custom response types I specified in the types folder. Strangely, the 401 errors did show correctly, maybe because those responses were smaller? Either way, we have a good system to validate if the next Axios update fixes this bug.

@Abhiek187 Abhiek187 added enhancement New feature or request dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Dec 4, 2022
@Abhiek187 Abhiek187 added this to In progress in EZ Recipes via automation Dec 4, 2022
@Abhiek187
Copy link
Owner Author

Abhiek187 commented Dec 4, 2022

I forgot that the Docker workflow only uses the Dockerfile, not docker-compose. (Those tests were quick though, I'm impressed!)

@Abhiek187 Abhiek187 merged commit a315184 into main Dec 4, 2022
EZ Recipes automation moved this from In progress to Done Dec 4, 2022
@Abhiek187 Abhiek187 deleted the test-apis branch December 4, 2022 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request javascript Pull requests that update Javascript code
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

TypeError (Error): Cannot read properties of undefined (reading 'nutrients')
1 participant