jest throws no errors

This commit is contained in:
2021-04-10 20:14:29 +02:00
parent ab6a108b4f
commit d1d6ce474b
2 changed files with 15 additions and 9 deletions

View File

@ -1,4 +1,6 @@
const CountOccurrences = require('@dsabot/CountOccurences'); const {
CountOccurences
} = require('../../functions/CountOccurences');
test('Counting Occurences', () => { test('Counting Occurences', () => {
expect(CountOccurrences([1, 2, 3, 4, 1],1)).toBe(2); expect(CountOccurences([1, 2, 3, 4, 1], 1)).toBe(2);
}); });

View File

@ -1,10 +1,14 @@
const Roll = require('@dsabot/Roll'); const {
roll
} = require('../../functions/Roll');
describe('Beware of a misunderstanding! A sequence of dice rolls', () => { describe('rolling dice', () => {
const expected = [1,2,3,4,5,6]; const expected = [1, 2, 3, 4, 5, 6];
it('matches even with an unexpected number 7', () => { it('contain only numbers from 1 to 6', () => {
expect(Roll(1,6)).not.toEqual( expect(roll(100, 6).dice).toEqual(
expect.arrayContaining(expected), expect.arrayContaining(expected),
); );
}); });
}); });
//todo: return sum