Add an inhouse hero, Hall of Fame, rankings, and event-specific schedules. Carry the event type through the API and admin tools, and improve results and player history displays.
23 lines
770 B
TypeScript
23 lines
770 B
TypeScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
import { multiKillLabel, rankPositionRates } from '../src/lib/multi-kill.ts';
|
|
|
|
test('labels only real multi kills and caps at a penta kill', () => {
|
|
assert.equal(multiKillLabel(undefined), undefined);
|
|
assert.equal(multiKillLabel(1), undefined);
|
|
assert.equal(multiKillLabel(2), '더블킬');
|
|
assert.equal(multiKillLabel(4), '쿼드라킬');
|
|
assert.equal(multiKillLabel(6), '펜타킬');
|
|
});
|
|
|
|
test('orders played positions by rate and drops empty ones', () => {
|
|
assert.deepEqual(
|
|
rankPositionRates({ TOP: 32, MIDDLE: 58, JUNGLE: 0, BOTTOM: 10 }),
|
|
[
|
|
{ lane: 'MIDDLE', rate: 58 },
|
|
{ lane: 'TOP', rate: 32 },
|
|
],
|
|
);
|
|
assert.deepEqual(rankPositionRates({}), []);
|
|
});
|