m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/__tests__/dice.test.js
diff options
context:
space:
mode:
Diffstat (limited to '__tests__/dice.test.js')
-rw-r--r--__tests__/dice.test.js23
1 files changed, 22 insertions, 1 deletions
diff --git a/__tests__/dice.test.js b/__tests__/dice.test.js
index 272f436..fb8a155 100644
--- a/__tests__/dice.test.js
+++ b/__tests__/dice.test.js
@@ -13,7 +13,8 @@ const {
keepLow,
again,
againUnder,
- threshold
+ threshold,
+ thresholdLow
} = require('../src/dice.js')
const defaultNumberRolls = 500
@@ -625,4 +626,24 @@ describe('threshold', () => {
}
})
})
+
+ describe('4t3d10', () => {
+ const die = thresholdLow(constant(4), d(constant(3), constant(10)))
+
+ testDie(die, {
+ diceCount: 3,
+ average: {
+ average: 1.2
+ },
+ variance: {
+ variance: 0.72
+ },
+ bounds: {
+ low: 0,
+ high: 3,
+ expectLow: true,
+ expectHigh: true
+ }
+ })
+ })
})