-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add sample unit tests to the starter game template #46
Conversation
Important Auto Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe recent update in the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
I think the whole non-ECS recovery stuff is way too implementation-specific and strays away from the purpose of the starter game template to serve as a scaffold for game projects. If the goal of this is to provide examples or "cookbooks" for a specific edgecases, then we should do this in a separate examples repository. |
|
||
// MustInitWorld registers all components, messages, queries, and systems. This initialization happens in a helper | ||
// function so that this can be used directly in tests. | ||
func MustInitWorld(w *cardinal.World) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want this, seems like an unnecessary hop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's to ensure the test setup code matches the code that will eventually be deployed with world cardinal start
. If we leave everything in the main function, I don't know how we would inject the test fixture world.
@coderabbitai review |
Looks like it would be better if added |
@zulkhair I added a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Add a github action to run the test
Add some sample unit test to the starter-game-template to demonstrate how testutils.TestFixture can be used to facilitate unit tests.
Specifically:
Summary by CodeRabbit