Allow to transform the execution environment of a spec item
@sol I've wanted this ability as well, so 👍🏿 - I'm curious what prompted it in your case (see the above linked issue for why I think we need this).
I've wanted this ability as well, so 👍🏿
@srid it will take a while until I'll be able to get back to this, but quickly, what do you need:
- Access additional configuration in
SpecM? - Access additional configuration from within hooks / an
it/ a customExampleinstance?
(if both would work, please state so)
@sol More like,
- Add project-specific custom test configuration type, and
- Modify that configuration for a certain sub-tree (
describe) of spec forest
I thought the StateT Int in your example demonstrated pretty much this (assuming Int is that configuration). In our case, this configuration would be a configuration type specifying where to generate golden tests and which goldens, in particular, to create (of which certain tests may override).
@srid that sounds like (1), right? This PR is (2). However, I think (1) will be easier. There are some complications with this PR that I'll try to note down when I have time. But in short, the approach in this PR does not play nice with how we are doing QC properties. So it's not clear if/when this will land (possibly we will have it as an alternate approach for experimentation).
@srid if you want your use case covered, can you please open a separate issue and give a minimal use case (actual code with imports that type checks, fill in the things that are not possible with hspec right now with undefined).