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.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/__tests__/dice.test.js b/__tests__/dice.test.js
index d4e2802..272f436 100644
--- a/__tests__/dice.test.js
+++ b/__tests__/dice.test.js
@@ -12,6 +12,7 @@ const {
keepHigh,
keepLow,
again,
+ againUnder,
threshold
} = require('../src/dice.js')
@@ -579,6 +580,29 @@ describe('again', () => {
}
})
})
+
+ describe('1a1d6', () => {
+ const die = againUnder(constant(1), d(constant(1), constant(6)))
+
+ testDie(die, {
+ variableDiceCount: {
+ min: 1,
+ max: Infinity
+ },
+ average: {
+ average: 4.2
+ },
+ variance: {
+ variance: 2.24
+ },
+ bounds: {
+ low: 2,
+ high: Infinity,
+ expectLow: true,
+ expectHigh: false
+ }
+ })
+ })
})
describe('threshold', () => {