|
|
@ -3,12 +3,12 @@ const diceroll = require('./diceroll.js'); |
|
|
|
describe('diceroll markdown', () => { |
|
|
|
describe('diceroll markdown', () => { |
|
|
|
|
|
|
|
|
|
|
|
const prepareCases = [ |
|
|
|
const prepareCases = [ |
|
|
|
{ in: '##3d6', out: '##3d6=' }, |
|
|
|
{ in: '##3%6', out: '##3%6=' }, |
|
|
|
{ in: '##99d99', out: '##99d99=' }, |
|
|
|
{ in: '##99%99', out: '##99%99=' }, |
|
|
|
{ in: '##999d999', out: '##999d999' }, |
|
|
|
{ in: '##999%999', out: '##999%999' }, |
|
|
|
{ in: '##3d8+5', out: '##3d8+5=' }, |
|
|
|
{ in: '##3%8+5', out: '##3%8+5=' }, |
|
|
|
{ in: '##3d8-5', out: '##3d8-5=' }, |
|
|
|
{ in: '##3%8-5', out: '##3%8-5=' }, |
|
|
|
{ in: '##0d0', out: '##0d0' }, |
|
|
|
{ in: '##0%0', out: '##0%0' }, |
|
|
|
]; |
|
|
|
]; |
|
|
|
for(let i in prepareCases) { |
|
|
|
for(let i in prepareCases) { |
|
|
|
test(`should contain ${prepareCases[i].out} for an input of ${prepareCases[i].in}`, () => { |
|
|
|
test(`should contain ${prepareCases[i].out} for an input of ${prepareCases[i].in}`, () => { |
|
|
@ -18,10 +18,11 @@ describe('diceroll markdown', () => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const markdownCases = [ |
|
|
|
const markdownCases = [ |
|
|
|
{ in: '##3d6=10', out: 'Rolled 3 dice with 6 sides =' }, |
|
|
|
{ in: '##3%6=10', out: '(##3%6)' }, |
|
|
|
{ in: '##99d99=5138', out: 'Rolled 99 dice with 99 sides =' }, |
|
|
|
{ in: '##99%99=5138', out: '(##99%99)' }, |
|
|
|
{ in: '##999d999=10000', out: '##999d999=10000' }, |
|
|
|
{ in: '##999%999=10000', out: '##999%999=' }, |
|
|
|
{ in: '##0d0', out: '##0d0' }, |
|
|
|
{ in: '##0%0=10', out: '##0%0=' }, |
|
|
|
|
|
|
|
{ in: '##0%0', out: '##0%0' }, |
|
|
|
]; |
|
|
|
]; |
|
|
|
for(let i in markdownCases) { |
|
|
|
for(let i in markdownCases) { |
|
|
|
test(`should contain ${markdownCases[i].out} for an input of ${markdownCases[i].in}`, () => { |
|
|
|
test(`should contain ${markdownCases[i].out} for an input of ${markdownCases[i].in}`, () => { |
|
|
|