14 lines
418 B
TypeScript
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]);
|
|
}
|
|
}
|
|
});
|