Skip to content

Mock context for unit testing #44

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

Closed
musjj opened this issue Feb 20, 2025 · 2 comments
Closed

Mock context for unit testing #44

musjj opened this issue Feb 20, 2025 · 2 comments
Labels
question Further information is requested

Comments

@musjj
Copy link

musjj commented Feb 20, 2025

Is there a way to perform unit tests on handlers without using integration tests? There doesn't seem to be a way to mock the context objects in the SDK.

@slinkydeveloper slinkydeveloper added the question Further information is requested label Feb 20, 2025
@slinkydeveloper
Copy link
Collaborator

Hi, this is at the moment not planned. Thanks to the contribution here #41 you can now test using testcontainers, and that's what we generally recommend people to do, as it gives guarantees that the code will behave similarly to how it would behave in production. More on the matter here: restatedev/documentation#377

@slinkydeveloper
Copy link
Collaborator

I close as for now i consider this solved with restate-sdk-testcontainers, which will be available in the next release. Re-open if you need it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants