m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/__tests__
diff options
context:
space:
mode:
Diffstat (limited to '__tests__')
-rw-r--r--__tests__/dice.test.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/__tests__/dice.test.js b/__tests__/dice.test.js
index 6fb48a2..3073fee 100644
--- a/__tests__/dice.test.js
+++ b/__tests__/dice.test.js
@@ -7,6 +7,7 @@ const {
negative,
explode,
keepHigh,
+ keepLow,
bonusAdd
} = require('../src/dice.js')
@@ -406,6 +407,31 @@ describe('keep', () => {
const die = keepHigh(constant(2), d(constant(1), constant(20)))
testDie(die, basicDieTestSpecs(1, 20))
})
+
+ describe('1k2d20', () => {
+ const die = keepLow(constant(1), d(constant(2), constant(20)))
+
+ testDie(die, {
+ diceCount: 1,
+ average: {
+ average: 7.175
+ },
+ variance: {
+ variance: 22.194
+ },
+ bounds: {
+ low: 1,
+ high: 20,
+ expectLow: true,
+ expectHigh: true
+ }
+ }, 800)
+ })
+
+ describe('2k1d20', () => {
+ const die = keepLow(constant(2), d(constant(1), constant(20)))
+ testDie(die, basicDieTestSpecs(1, 20))
+ })
})
describe('bonusAdd', () => {