-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
36 lines (25 loc) · 1.04 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var expect = require('chai').expect;
describe('random-bool', function () {
var randomBool = require('../../');
it('randomBool()', function () {
expect(randomBool()).to.be.a('boolean');
});
it('randomBool({ likelihood: 30 })', function () {
expect(randomBool({ likelihood: 30 })).to.be.a('boolean');
});
it('randomBool({ likelihood: 0 }) => should always be false', function () {
expect(randomBool({ likelihood: 0 })).to.equal(false);
});
it('randomBool({ likelihood: 100 }) => should always be true', function () {
expect(randomBool({ likelihood: 100 })).to.equal(true);
});
it('randomBool({ likelihood: "a" }) => should always be false', function () {
expect(randomBool({ likelihood: "a" })).to.equal(false);
});
it('randomBool({ likelihood: [] }) => should always be false', function () {
expect(randomBool({ likelihood: [] })).to.equal(false);
});
it('randomBool({ likelihood: {} }) => should always be false', function () {
expect(randomBool({ likelihood: {} })).to.equal(false);
});
});