Cleanup (#19)
* reformatting of skill checks table * Including own Random "generator", more refactoring
This commit is contained in:
12
__tests__/functions/CalculateQuality.js
Normal file
12
__tests__/functions/CalculateQuality.js
Normal file
@ -0,0 +1,12 @@
|
||||
const {CalculateQuality} = require('@dsabot/CalculateQuality');
|
||||
|
||||
const TestValues = [
|
||||
[1,1], [2,1], [3,1],
|
||||
[4,2], [5,2], [6,2],
|
||||
[7,3], [8,3], [9,3],
|
||||
[10,4],[11,4],[12,4],
|
||||
[13,5],[14,5],[15,5]
|
||||
];
|
||||
test.each(TestValues)('Retrieving Quality for %s', (input, output) => {
|
||||
expect(CalculateQuality(input)).toBe(output);
|
||||
});
|
@ -1,14 +1,8 @@
|
||||
const {
|
||||
roll
|
||||
} = require('../../functions/Roll');
|
||||
const { roll } = require('@dsabot/Roll');
|
||||
|
||||
describe('rolling dice', () => {
|
||||
const expected = [1, 2, 3, 4, 5, 6];
|
||||
it('contain only numbers from 1 to 6', () => {
|
||||
expect(roll(100, 6).dice).toEqual(
|
||||
expect.arrayContaining(expected),
|
||||
);
|
||||
test.each(expected)('contains only numbers from 1 to 6', (value) => {
|
||||
expect(roll(200, 6).dice).toContain(value);
|
||||
});
|
||||
});
|
||||
|
||||
//todo: return sum
|
||||
});
|
Reference in New Issue
Block a user