Custom examples for property(..., context(), ...)?
See original GitHub issue💬 Question and Help
It is unclear to me how to provide a custom example for the following:
fc.assert(
fc.property(fc.string(), fc.context(), (str, ctx) => /* ... */),
{ examples: [["x", /* what here? */]] }
);
context()
seems to instantiate an class which is not exported. I would prefer not to make my own implementation of ContextValue
.
It would be the most convenient not to have to include a value corresponding to the context in the examples at all – maybe the arbitraries provided to the property call could be used if there are more of them than elements in the example tuples – but any solution that gets this to work is good enough. Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
A Complete Guide to Custom Properties | CSS-Tricks
A custom property is most commonly thought of as a variable in CSS. ... Here are some basic examples that you'd expect to...
Read more >Using CSS custom properties (variables) - MDN Web Docs
For example, the same color might be used in hundreds of different places, requiring global search and replace if that color needs to...
Read more >Context menu for the custom properties in the C# PropertyGrid
Context menu for the custom properties in the C# PropertyGrid, allowing the user to reset the properties, the same way as in Visual...
Read more >Bind Custom Property to Context - Stack Overflow
I like to bind a custom property (owner Window) to my datacontext. How to do these in xaml. I can not access on...
Read more >Custom Context Menu Items - MicroStrategy
For example, whether to show the Date Labels on your visualization, ... Most menu items can bind with custom properties. ... onClick: function...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello,
There is today no way to build partial or incomplete examples. A proposal to do so was suggested in the issue https://github.com/dubzzz/fast-check/issues/710#issuecomment-657102743 but for the moment it has not been implemented.
Regarding
ContextValue
for the moment, the implementation is not exposed to the user. I should probably either expose the class or add something likefc.contextFor()
as I did forfc.scheduler()
(seefc.schedulerFor()
).Given what has been released so far, the only trick I’d have is:
Not perfect but it should work well.
Sure thing!
I have submitted a proper bug report here, and also two suggestions for improving the docs if fixing the bug will never be on the roadmap here and here!