m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/__tests__/dice.test.js
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-08-30 16:25:34 -0400
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-08-30 16:25:34 -0400
commit7efea0582dda35cd7dc0c370ef3b56c84b2f2291 (patch)
treeb6c3560651564cb335a52b3980c8e28b4e78326b /__tests__/dice.test.js
parentca6103457d9a4bb7e11a406f689ed1de46720781 (diff)
Implement explode under
Diffstat (limited to '__tests__/dice.test.js')
-rw-r--r--__tests__/dice.test.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/__tests__/dice.test.js b/__tests__/dice.test.js
index 12d9130..d4e2802 100644
--- a/__tests__/dice.test.js
+++ b/__tests__/dice.test.js
@@ -8,6 +8,7 @@ const {
bonusSubtract,
negative,
explode,
+ explodeUnder,
keepHigh,
keepLow,
again,
@@ -483,6 +484,24 @@ describe('exploding dice', () => {
}
})
})
+
+ describe('1e1d6', () => {
+ const die = explodeUnder(constant(1), d(constant(1), constant(6)))
+ testDie(die, {
+ diceCount: 1,
+ average: {
+ average: 4.2
+ },
+ variance: {
+ variance: 2.24
+ },
+ bounds: {
+ low: 2,
+ expectLow: true,
+ high: Infinity
+ }
+ })
+ })
})
describe('keep', () => {