thomashoneyman / purescript-halogen-hooks

Reusable stateful logic in Halogen, inspired by React Hooks
https://thomashoneyman.com/articles/introducing-halogen-hooks
MIT License
115 stars 13 forks source link

Make test code available to other packages #24

Open JordanMartinez opened 4 years ago

JordanMartinez commented 4 years ago

This is sort of a funny situation... If I want to write a test for hooks in the purescript-halogen-hooks-extra library, I have to add a souce glob via .spago/halogen-hooks/*/test/**/*.purs to even access the types you added to write tests.

I'd like to propose moving all of that information into the src directory, so that users of this library can use that code in their testing as well without having to add in a source glob like I do now.

JordanMartinez commented 4 years ago

On second thought... this is actually problematic because the main code would then depend upon purescript-spec when only the test code should depend upon that... Hm...

JordanMartinez commented 4 years ago

The solution is basically another repo, but that's kind of a pain when the test code should be tightly coupled to this code here (such as if that specific function in the src code changes, then the corresponding one in the test code should likewise change)

thomashoneyman commented 4 years ago

Yea, I would like to polish up the tests so they support queries, too, and then I’d like to publish them as a separate library so that the functions can be used on custom hooks. But it would also be nice not to have it in a separate repository.

I’m interested in exploring a monorepo with two packages so things can be kept in sync.