Boolean generator
Random boolean generator.
const { bool } = require("chance-generators");
Without any arguments it generates random booleans:
expect(bool.take(5), "to equal", [true, false, false, true, false]);
You can control the likelihood of returning true
:
expect(bool({ likelihood: 30 }).take(5), "to equal", [false, false, false, true, false]);