Sampling a property throws an error inside fast-check: "this.arb.withBias is not a function"
See original GitHub issue🐛 Bug Report
I want to be able to change the assert function to a sample and see what values might be input into my test.
However, when I sample a property, I get the following error:
TypeError: this.arb.withBias is not a function
45 |
46 | test('reproduction', () => {
> 47 | fc.sample(fc.property(fc.integer(), () => {})).forEach(console.log)
| ^
48 | })
49 |
at ConverterToNext.generate (node_modules/fast-check/lib/check/arbitrary/definition/ConverterToNext.js:33:55)
at Property.generate (node_modules/fast-check/lib/check/property/Property.generic.js:28:32)
at node_modules/fast-check/lib/check/runner/Tosser.js:9:28
at node_modules/fast-check/lib/check/runner/Sampler.js:26:62
at mapHelper (node_modules/fast-check/lib/stream/StreamHelpers.js:19:15)
at mapHelper.next (<anonymous>)
at Object.sample (node_modules/fast-check/lib/check/runner/Sampler.js:33:16)
at Object.<anonymous> (test/connectDisconnectModel.test.ts:47:6)
To Reproduce
fc.sample(fc.property(fc.integer(), () => {})).forEach(console.log)
Expected behavior
Doesn’t throw, prints out all the delicious generated parameters.
Your environment
Packages / Softwares | Version(s) |
---|---|
fast-check | 2.22.0 |
node | 16.3.0 |
TypeScript* | 4.5.5 |
*Only for TypeScript’s users
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Issues · dubzzz/fast-check - GitHub
Property based testing framework for JavaScript (like QuickCheck) written in TypeScript - Issues · dubzzz/fast-check.
Read more >fast-check - npm
Property based testing framework for JavaScript (like QuickCheck). Latest version: 3.3.0, last published: 10 days ago.
Read more >fast-check - Property based testing for JavaScript and TypeScript
Property based testing is another way to test programs. Instead of relying on hard-coded inputs and outputs, it checks characteristics of the output...
Read more >Untitled
Inkerman ontario weather, Boc born mens boots, Stephen joseph gifts singapore, Ifugao language philippines, Tresham house dunchurch, Grammaire russe en ...
Read more >Illund the S;5i S Transistor Transmitter - World Radio History
Please rush the new Model FC-2 FAST -CHECK TUBE TESTER for a 10 day trial period ... Throwing. Warping and Weaving. Worsted Manufacturing....
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
Woups this is indeed not expected. Good catch 😱
Fixed in v3