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

[WIP] Json.Bidirectional.Fuzzable #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

jamesmacaulay
Copy link
Owner

This branch has a new module, Json.Bidirectional.Fuzzable, which is an altered version of Json.Bidirectional that builds up Fuzzer values from elm-test's Fuzz module along with the Encoder and Decoder. This lets you fuzz values for a Coder without having to define the Fuzzer yourself. See FuzzableTests.elm to see what this is like in practice – it's very similar to Tests.elm, but the fuzzers are provided automatically by the Coders.

The thing is: I'm not sure the best way to offer this functionality. Using these fuzzable Coders in production code means including the Fuzz module and its dependencies in your production build. If you don't want that, then you could stick to the Json.Bidirectional module and not add anything extra to your production build – but having this new Fuzz-dependent module in the same package means that elm-test 4.x.x would become a transitive dependency of every app that uses elm-json-bidirectional.

I've been trying to figure out a way of having an "extensible" version of Json.Bidirectional that could somehow allow you to extend it with Fuzzer-building capability "after the fact", without having a dependency on the Fuzz module itself. I have some ideas, but nothing that would provide comparable ergonomics to what's there right now.

My current thinking is to release a completely different package (elm-json-bidirectional-fuzzable ?) in order to keep elm-json-bidirectional free of the elm-test dependency. But I welcome any suggestions!

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

Successfully merging this pull request may close these issues.

1 participant