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

add the ability to generate assertions off of actual instances #3999

Open
AlexCue987 opened this issue May 3, 2024 · 4 comments
Open

add the ability to generate assertions off of actual instances #3999

AlexCue987 opened this issue May 3, 2024 · 4 comments
Labels
assertions 🔍 Related to the assertion mechanisms within the testing framework. enhancement ✨ Suggestions for adding new features or improving existing ones. framework 🏗️ Pertains to the core structure and components of the Kotest framework.

Comments

@AlexCue987
Copy link
Member

I've developed a small library that generates kotest assertions and mocks off of actual data:
https://github.com/AlexCue987/kotests-mockks-generator

It does not publish to Maven yet.
Is there any appetite to add it to kotest org?

@LeoColman LeoColman added enhancement ✨ Suggestions for adding new features or improving existing ones. assertions 🔍 Related to the assertion mechanisms within the testing framework. framework 🏗️ Pertains to the core structure and components of the Kotest framework. labels May 9, 2024
@LeoColman
Copy link
Member

I'm not sure it should be incorporated to the core code.

It would need maintenance to something we try the best we can to avoid: bringing mocking dependencies in.

I think it should be kept as an external library. In that case we could also add it to one of external libraries in assertions

@AlexCue987
Copy link
Member Author

I'm not sure it should be incorporated to the core code.

It would need maintenance to something we try the best we can to avoid: bringing mocking dependencies in.

I think it should be kept as an external library. In that case we could also add it to one of external libraries in assertions

Fair enough. I can remove all things related to mocking elsewhere, so that this small library deals with kotest and nothing else. Would it address your concerns, @LeoColman ?

@sksamuel
Copy link
Member

The idea to derive kotest assertion is great, but not the mocking bit.
As @LeoColman says we want to keep mocking out.

Can you describe a bit more about how it would work without the mocking part? I read your readme, which is nicely detailed, but couldn't quite separate out the mocking from the non mocking bit.

@AlexCue987
Copy link
Member Author

This version of the library does not mention any mocks at all. And its only dependency is reflection:

https://github.com/AlexCue987/kotest-generators

WDYT @sksamuel @LeoColman ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assertions 🔍 Related to the assertion mechanisms within the testing framework. enhancement ✨ Suggestions for adding new features or improving existing ones. framework 🏗️ Pertains to the core structure and components of the Kotest framework.
Projects
None yet
Development

No branches or pull requests

3 participants