secsan/test/shuffle.test.ts
Ashhhleyyy b2d88bd1c2
All checks were successful
continuous-integration/drone/push Build is passing
chore: format with prettier
2022-11-10 14:58:38 +00:00

14 lines
418 B
TypeScript

import { expect, test } from 'vitest';
import { buildNameMap } from '../src/shuffle';
test('shuffle does not include matching pairs', () => {
const names = Array(10)
.fill(null)
.map((_, i) => `Test ${i}`);
for (let i = 0; i < 50000; i++) {
const shuffled = buildNameMap(names);
for (const pair of shuffled) {
expect(pair[0]).not.toBe(pair[1]);
}
}
});