-
Notifications
You must be signed in to change notification settings - Fork 11
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 tests for all the API endpoints #43
Comments
I'd like to pick this up. |
Hey, thank you for taking an interest, your help would be much appreciated :) |
No problem, I hope to be helpful :) |
One thing I'd like to note as I'm not sure if it's obvious from the code itself is that almost all routes expect the guid to be sent and not the numerical id as a parameter for the request. Some routes such as those for the city and/or country use the numerical ID. |
I'm having a problem trying to run migrations. I have setup the MySQL DB, but every time I try to run the
What am I doing wrong? |
I've noticed that issue my self when using older versions of MariaDB database < 10.4.6. I've successfully imported migrations on versions 10.4.6 and 10.5.5. |
I've merged the new version of migrations into the main branch which should allow you to run all the migrations without any issues. Do let me know if there are any problems with it. |
We you able to run the migrations since the new update? |
Hi, Igor. Sorry about the delay, these days were exhausting. I've tried to run them after your update, but no luck. Some of the tables didn't update. I'll try another run later today and let you know if I succeed, and if doesn't work, I'll share the output with you. |
Hey, no worries. I think you will need to delete all the tables first and than run the migrations as I didn't create new ones but rather rewrote the old ones. So it needs to be a clean database for it to succeed. I tested it on 10.4.1 without any issues, so now it should be good. When you have the time, try and just let me know. If it still throws errors I'll try and update it more. |
There should be tests created for all the API routes.
Some resources for it:
Testing ExpressJS REST API with Mocha and Chai | MediumHow to Test Nodejs Code and RESTful API | CodeForGeek
Testing NodeJs/Express API with Jest and Supertest | Dev.to
Mocking ExpressJS Request and Response objects | ITNEXT
The projects programming language has changed from typescript to php so these links are no longer useful.
New links:
As always any help and/or feedback is welcomed :)
The text was updated successfully, but these errors were encountered: