Skip to content

Add tests for qse init command with docker-compose flag, using cache service and db enabled#112

Merged
Ashrockzzz2003 merged 11 commits intoCSE-25:mainfrom
afmireski:feature-add-tests-for-qse-init-with-docker-compose-using-cache-and-db
Feb 25, 2025
Merged

Add tests for qse init command with docker-compose flag, using cache service and db enabled#112
Ashrockzzz2003 merged 11 commits intoCSE-25:mainfrom
afmireski:feature-add-tests-for-qse-init-with-docker-compose-using-cache-and-db

Conversation

@afmireski
Copy link
Contributor

Resolves #110

Description

Implemented unit tests to verify template generation using the --docker-compose flag. To use cache and database services, some functions were mocked, removing the need to wait for user interactions.

Moved the initCommand logic to a separate file, init.js. This was necessary to prevent index.js from 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.

  • All new an existing tests passed

Waiting @Ashrockzzz2003 review.

@afmireski
Copy link
Contributor Author

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!

Copy link
Member

@Ashrockzzz2003 Ashrockzzz2003 left a comment

Choose a reason for hiding this comment

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

@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

@afmireski
Copy link
Contributor Author

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 Ashrockzzz2003 self-requested a review February 25, 2025 03:06
@Ashrockzzz2003 Ashrockzzz2003 changed the title [WIP] - Add tests for qse init command with docker-compose flag, using cache service and db enabled [Completed] - Add tests for qse init command with docker-compose flag, using cache service and db enabled Feb 25, 2025
Copy link
Member

@Ashrockzzz2003 Ashrockzzz2003 left a comment

Choose a reason for hiding this comment

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

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!

@Ashrockzzz2003 Ashrockzzz2003 changed the title [Completed] - Add tests for qse init command with docker-compose flag, using cache service and db enabled Add tests for qse init command with docker-compose flag, using cache service and db enabled Feb 25, 2025
@Ashrockzzz2003 Ashrockzzz2003 merged commit 6d5030a into CSE-25:main Feb 25, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request testing

Projects

Development

Successfully merging this pull request may close these issues.

Add tests for qse init command with docker-compose flag, using cache service and db enabled

2 participants