testcheck-js icon indicating copy to clipboard operation
testcheck-js copied to clipboard

Is gen.any supposed to generate any kind of values or only arrays or objects?

Open customcommander opened this issue 6 years ago • 3 comments

Hi,

The documentation for gen.any says:

Generates any JS value, including Arrays and Objects (possibly nested).

I ran this code a couple of times (± 10 times) and never had any single strings, numbers or booleans:

 sample(gen.any, 100).filter(x => typeof x !== 'object');

I know the values in the list are randomly generated but I should have received one non-array non-object value at least once. (Or I might just be extremely unlucky. )

Is gen.any supposed to produce only arrays or objects? In which case I'd recommend updating the documentation. Otherwise do you think this may be a bug?

I am using testcheck 1.0.0-rc.2

Thank you.

customcommander avatar Aug 23 '18 08:08 customcommander

👋 @leebyron

customcommander avatar Sep 01 '18 06:09 customcommander

@leebyron Any thoughts?

customcommander avatar Oct 13 '18 13:10 customcommander

@leebyron Are you still maintaining this repo? :)

customcommander avatar Jan 15 '19 13:01 customcommander