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

Allow to transform the execution environment of a spec item #667

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sol
Copy link
Member

@sol sol commented Apr 18, 2022

No description provided.

@srid
Copy link
Contributor

srid commented Apr 25, 2022

@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).

@sol
Copy link
Member Author

sol commented Apr 26, 2022

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:

  1. Access additional configuration in SpecM?
  2. Access additional configuration from within hooks / an it / a custom Example instance?

(if both would work, please state so)

@srid
Copy link
Contributor

srid commented Apr 26, 2022

@sol More like,

  1. Add project-specific custom test configuration type, and
  2. 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).

@sol
Copy link
Member Author

sol commented Apr 26, 2022

@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).

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.

None yet

3 participants