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: fix unit tests for API #108[wip] #131

Merged
merged 30 commits into from
Dec 9, 2023

Conversation

naftalimurgor
Copy link
Contributor

[WIP] Fix API tests after adding ORM

The tests cover pretty much what's required, the tests break due to a broken ts-auto-mock, what's being done:

  1. Do away with ts-auto-mock and use a package like jest-mock to offer better mocking
  2. Configure jest-mock Currently using jest.fn() and jest.mock(...) to mock most modules and methods
  3. Readjust tests and go from Red to green

Why is it needed?

This PR mainly aims at resolving #108 for Fixing failing API unit tests to resolve failing Github actions.

How to test it?

This PR is worked on as described in #108

Copy link

vercel bot commented Dec 5, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
isomera-compodoc ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 9, 2023 8:17pm
2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
isomera-landing ⬜️ Ignored (Inspect) Visit Preview Dec 9, 2023 8:17pm
isomera-platform ⬜️ Ignored (Inspect) Visit Preview Dec 9, 2023 8:17pm

@vygandas
Copy link
Contributor

vygandas commented Dec 5, 2023

@naftalimurgor , good start :)

To fix Prettier failed check just run prettier . --write - should do the trick 👌🏻

I also noticed the title "test: fix tests unit tests for profile.controller.ts" - are you planning to do PR for each separately?

@vygandas vygandas assigned vygandas and naftalimurgor and unassigned vygandas Dec 5, 2023
@vygandas vygandas added github_actions Pull requests that update GitHub Actions code back-end Only back-end tooling Only tools, kike docker, makefile, etc labels Dec 5, 2023
@vygandas vygandas added this to the [0] Basic necessities milestone Dec 5, 2023
@vygandas vygandas linked an issue Dec 5, 2023 that may be closed by this pull request
@naftalimurgor
Copy link
Contributor Author

@naftalimurgor , good start :)

To fix Prettier failed check just run prettier . --write - should do the trick 👌🏻

I also noticed the title "test: fix tests unit tests for profile.controller.ts" - are you planning to do PR for each separately?

Thanks for the pointing out the prettier :)

Regarding doing the tests seprately, we can do them all at once. This was just a way of making the draft PR active and to set the ball rolling on this issue

@vygandas
Copy link
Contributor

vygandas commented Dec 5, 2023

@naftalimurgor , oh yes, it can be all in one. I guess when the first few are done, all the rest should go easy 🙂

@naftalimurgor naftalimurgor changed the title test: fix tests unit tests for profile.controller.ts #108[wip] test: fix tests unit tests for API #108[wip] Dec 5, 2023
@naftalimurgor naftalimurgor changed the title test: fix tests unit tests for API #108[wip] test: fix unit tests for API #108[wip] Dec 6, 2023
@naftalimurgor
Copy link
Contributor Author

Hey @vygandas
I'll push some changes and resolve most of the highlighted areas today evening. Got a term paper today :)

@vygandas
Copy link
Contributor

vygandas commented Dec 8, 2023

Hey @vygandas I'll push some changes and resolve most of the highlighted areas today evening. Got a term paper today :)

Alright, no worries. Good luck with that! 😊

@naftalimurgor
Copy link
Contributor Author

Hey @vygandas I'll push some changes and resolve most of the highlighted areas today evening. Got a term paper today :)

Alright, no worries. Good luck with that! 😊

Thank you 😀

@vygandas
Copy link
Contributor

vygandas commented Dec 9, 2023

@naftalimurgor it's just prettier left 🤣 almost there...

@naftalimurgor
Copy link
Contributor Author

@vygandas
seeing things not looking pretty, let me fix that! :)

Copy link
Contributor

@vygandas vygandas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌🏻

@vygandas vygandas merged commit 2c169bb into cortip:main Dec 9, 2023
9 checks passed
@naftalimurgor
Copy link
Contributor Author

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back-end Only back-end github_actions Pull requests that update GitHub Actions code tooling Only tools, kike docker, makefile, etc
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Issue with unit tests after adding TypeORM
2 participants