Add tests for qse init command with docker-compose flag, using cache service and db enabled#112
Conversation
- That approach don't work well with mock attempts
- Moved was needed because if initCommand was called during tests, index.js was loaded, breaking the execution
|
Hello @Ashrockzzz2003, I tried to implement your idea of interface substitution as best as I could. I had initially designed a more modular approach, but I ran into issues with mocking. So, I ended up encapsulating the question logic in a separate function instead. If you run into any issues, just let me know. Thank you once again for the opportunity! |
Ashrockzzz2003
left a comment
There was a problem hiding this comment.
@afmireski
This is awesome
I'll merge #110 before this. There might just be minor merge conflicts. Just resolve them. Then we'll merge this one too!
Amazing work! Thank you
|
Hello @Ashrockzzz2003, I’ve resolved the conflicts resulting from the #106 merge. I ran the CLI and the tests, and all tests passed. I believe everything is working fine. |
Ashrockzzz2003
left a comment
There was a problem hiding this comment.
LGTM
Amazing work @afmireski
Thanks for the contribution!
Now because of this PR, it makes room for more tests. Overall testability of qse has increased because of your contribution promoting TDD!
Thank you!
Resolves #110
Description
Implemented unit tests to verify template generation using the
--docker-composeflag. To use cache and database services, some functions were mocked, removing the need to wait for user interactions.Moved the
initCommandlogic to a separate file,init.js. This was necessary to preventindex.jsfrom being loaded during tests and interfering with them.The logic for confirmation and selection questions using Inquirer was encapsulated in a separate file:
question/inquirer.js.Waiting @Ashrockzzz2003 review.