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

gen.oneOf throws an an error (not ISeqable) #99

Open
customcommander opened this issue Nov 1, 2019 · 3 comments
Open

gen.oneOf throws an an error (not ISeqable) #99

customcommander opened this issue Nov 1, 2019 · 3 comments

Comments

@customcommander
Copy link

The following code taken from the docs throws an error:

const numOrBool = gen.oneOf([ gen.int, gen.boolean ])

sample(numOrBool)

Output:

Error: [object Object],[object Object] is not ISeqable
    at E (/home/runner/node_modules/testcheck/dist/testcheck.js:90:423)
    at /home/runner/node_modules/testcheck/dist/testcheck.js:210:56
    at Ce (/home/runner/node_modules/testcheck/dist/testcheck.js:160:54)
    at Be.h.Y (/home/runner/node_modules/testcheck/dist/testcheck.js:162:291)
    at E (/home/runner/node_modules/testcheck/dist/testcheck.js:90:313)
    at Xe (/home/runner/node_modules/testcheck/dist/testcheck.js:183:52)
    at to (/home/runner/node_modules/testcheck/dist/testcheck.js:442:143)
    at Object.exports.gen.oneOf (/home/runner/node_modules/testcheck/dist/testcheck.js:734:136)
    at evalmachine.<anonymous>:3:23
    at Script.runInContext (vm.js:133:20)
@customcommander
Copy link
Author

@leebyron I love testcheck and would like to introduce it at work but this bug is a showstopper for me. I just want to know if you're still maintaining this project.

@camsjams
Copy link

camsjams commented Dec 5, 2019

Looks like this relates to #42

@camsjams
Copy link

camsjams commented Dec 14, 2019

On testcheck @1.0.0-rc.2 this code seems to function fine within the scope of node or a webpack/babel/TypeScript (@3.7.2) build.

It generates a value like:
[ false, false, true, true, -3, true, false, true, false, 4 ]

Can also be verified with latest on npm: https://npm.runkit.com/testcheck using this code:

const {gen, sample} = require("testcheck")

const numOrBool = gen.oneOf([ gen.int, gen.boolean ])

sample(numOrBool)

@customcommander can you share a little more about your code and versons:

  • Node version
  • TypeScript (if using)
  • Babel (if using)

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

No branches or pull requests

2 participants