Skip to content

Instantly share code, notes, and snippets.

@MattMcFarland
Created March 15, 2017 00:14
Show Gist options
  • Save MattMcFarland/61f8134f49fdefb0ba3b39d772621f95 to your computer and use it in GitHub Desktop.
Save MattMcFarland/61f8134f49fdefb0ba3b39d772621f95 to your computer and use it in GitHub Desktop.
js verify with chance
const jsc = require('jsverify')
const Chance = require('chance')
const chance = new Chance()
chance.mixin({
user: () => ({
first: chance.first(),
last: chance.last(),
email: chance.email()
})
})
const arbUser = jsc.bless({
generator: () => chance.user()
})
// lets test our user here:
jsc.check(jsc.forall(arbUser, (user) => {
console.log(user)
return true
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment