tft-dataset
Version:
Basic informations on current tft set.
196 lines (195 loc) • 9.57 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const vitest_1 = require("vitest");
const champions_1 = require("./champions");
const synergy_name_1 = require("./synergy-name");
const champion_name_1 = require("./champion-name");
(0, vitest_1.test)("Champions count should match champion names", () => {
(0, vitest_1.expect)(champions_1.champions.length).toEqual(Object.values(champion_name_1.ChampionName).length);
});
(0, vitest_1.test)("Five costs", () => {
const fiveCosts = champions_1.champions.filter((c) => c.cost === 5);
(0, vitest_1.expect)(fiveCosts.length).toEqual(8);
const rangeSum = champions_1.champions
.filter((c) => c.cost === 5)
.reduce((sum, c) => sum + c.range, 0);
(0, vitest_1.expect)(rangeSum).toEqual(20);
});
(0, vitest_1.test)("Four costs", () => {
const fourCosts = champions_1.champions.filter((c) => c.cost === 4);
(0, vitest_1.expect)(fourCosts.length).toEqual(13);
const rangeSum = champions_1.champions
.filter((c) => c.cost === 4)
.reduce((sum, c) => sum + c.range, 0);
(0, vitest_1.expect)(rangeSum).toEqual(31);
});
(0, vitest_1.test)("Three costs", () => {
const threeCosts = champions_1.champions.filter((c) => c.cost === 3);
(0, vitest_1.expect)(threeCosts.length).toEqual(16);
const rangeSum = champions_1.champions
.filter((c) => c.cost === 3)
.reduce((sum, c) => sum + c.range, 0);
(0, vitest_1.expect)(rangeSum).toEqual(41);
});
(0, vitest_1.test)("Two costs", () => {
const twoCosts = champions_1.champions.filter((c) => c.cost === 2);
(0, vitest_1.expect)(twoCosts.length).toEqual(13);
const rangeSum = champions_1.champions
.filter((c) => c.cost === 2)
.reduce((sum, c) => sum + c.range, 0);
(0, vitest_1.expect)(rangeSum).toEqual(28);
});
(0, vitest_1.test)("One costs", () => {
const oneCosts = champions_1.champions.filter((c) => c.cost === 1);
(0, vitest_1.expect)(oneCosts.length).toEqual(14);
});
(0, vitest_1.test)("Battle Academia", () => {
const synergies = champions_1.champions
.flatMap((c) => c.synergies)
.filter((synergyName) => synergyName === synergy_name_1.SynergyName.BattleAcademia);
(0, vitest_1.expect)(synergies.length).toEqual(8);
const costSum = champions_1.champions
.filter((c) => c.synergies.includes(synergy_name_1.SynergyName.BattleAcademia))
.reduce((sum, c) => sum + c.cost, 0);
(0, vitest_1.expect)(costSum).toEqual(3 + 1 + 1 + 3 + 2 + 4 + 2 + 4);
});
(0, vitest_1.test)("Crystal Gambit", () => {
const synergies = champions_1.champions
.flatMap((c) => c.synergies)
.filter((synergyName) => synergyName === synergy_name_1.SynergyName.CrystalGambit);
(0, vitest_1.expect)(synergies.length).toEqual(6);
const costSum = champions_1.champions
.filter((c) => c.synergies.includes(synergy_name_1.SynergyName.CrystalGambit))
.reduce((sum, c) => sum + c.cost, 0);
(0, vitest_1.expect)(costSum).toEqual(4 + 2 + 3 + 1 + 2 + 5);
});
(0, vitest_1.test)("Luchador", () => {
const synergies = champions_1.champions
.flatMap((c) => c.synergies)
.filter((synergyName) => synergyName === synergy_name_1.SynergyName.Luchador);
(0, vitest_1.expect)(synergies.length).toEqual(4);
const costSum = champions_1.champions
.filter((c) => c.synergies.includes(synergy_name_1.SynergyName.Luchador))
.reduce((sum, c) => sum + c.cost, 0);
(0, vitest_1.expect)(costSum).toEqual(5 + 2 + 1 + 4);
});
(0, vitest_1.test)("Mentor", () => {
const synergies = champions_1.champions
.flatMap((c) => c.synergies)
.filter((synergyName) => synergyName === synergy_name_1.SynergyName.Mentor);
(0, vitest_1.expect)(synergies.length).toEqual(4);
const costSum = champions_1.champions
.filter((c) => c.synergies.includes(synergy_name_1.SynergyName.Mentor))
.reduce((sum, c) => sum + c.cost, 0);
(0, vitest_1.expect)(costSum).toEqual(2 + 4 + 3 + 3);
});
(0, vitest_1.test)("Mighty Mech", () => {
const synergies = champions_1.champions
.flatMap((c) => c.synergies)
.filter((synergyName) => synergyName === synergy_name_1.SynergyName.MightyMech);
(0, vitest_1.expect)(synergies.length).toEqual(7);
const costSum = champions_1.champions
.filter((c) => c.synergies.includes(synergy_name_1.SynergyName.MightyMech))
.reduce((sum, c) => sum + c.cost, 0);
(0, vitest_1.expect)(costSum).toEqual(1 + 2 + 4 + 4 + 1 + 3 + 5);
});
(0, vitest_1.test)("Monster Trainer", () => {
const synergies = champions_1.champions
.flatMap((c) => c.synergies)
.filter((synergyName) => synergyName === synergy_name_1.SynergyName.MonsterTrainer);
(0, vitest_1.expect)(synergies.length).toEqual(4);
const costSum = champions_1.champions
.filter((c) => c.synergies.includes(synergy_name_1.SynergyName.MonsterTrainer))
.reduce((sum, c) => sum + c.cost, 0);
(0, vitest_1.expect)(costSum).toEqual(3 + 3 + 3 + 3);
});
(0, vitest_1.test)("Rogue Captain", () => {
const synergies = champions_1.champions
.flatMap((c) => c.synergies)
.filter((synergyName) => synergyName === synergy_name_1.SynergyName.RogueCaptain);
(0, vitest_1.expect)(synergies.length).toEqual(1);
const costSum = champions_1.champions
.filter((c) => c.synergies.includes(synergy_name_1.SynergyName.RogueCaptain))
.reduce((sum, c) => sum + c.cost, 0);
(0, vitest_1.expect)(costSum).toEqual(5);
});
(0, vitest_1.test)("Soul Fighter", () => {
const synergies = champions_1.champions
.flatMap((c) => c.synergies)
.filter((synergyName) => synergyName === synergy_name_1.SynergyName.SoulFighter);
(0, vitest_1.expect)(synergies.length).toEqual(8);
const costSum = champions_1.champions
.filter((c) => c.synergies.includes(synergy_name_1.SynergyName.SoulFighter))
.reduce((sum, c) => sum + c.cost, 0);
(0, vitest_1.expect)(costSum).toEqual(5 + 1 + 2 + 1 + 4 + 4 + 3 + 2);
});
(0, vitest_1.test)("Stance Master", () => {
const synergies = champions_1.champions
.flatMap((c) => c.synergies)
.filter((synergyName) => synergyName === synergy_name_1.SynergyName.StanceMaster);
(0, vitest_1.expect)(synergies.length).toEqual(1);
const costSum = champions_1.champions
.filter((c) => c.synergies.includes(synergy_name_1.SynergyName.StanceMaster))
.reduce((sum, c) => sum + c.cost, 0);
(0, vitest_1.expect)(costSum).toEqual(5);
});
(0, vitest_1.test)("Star Guardian", () => {
const synergies = champions_1.champions
.flatMap((c) => c.synergies)
.filter((synergyName) => synergyName === synergy_name_1.SynergyName.StarGuardian);
(0, vitest_1.expect)(synergies.length).toEqual(7);
const costSum = champions_1.champions
.filter((c) => c.synergies.includes(synergy_name_1.SynergyName.StarGuardian))
.reduce((sum, c) => sum + c.cost, 0);
(0, vitest_1.expect)(costSum).toEqual(3 + 4 + 3 + 4 + 1 + 5 + 2);
});
(0, vitest_1.test)("Supreme Cells", () => {
const synergies = champions_1.champions
.flatMap((c) => c.synergies)
.filter((synergyName) => synergyName === synergy_name_1.SynergyName.SupremeCells);
(0, vitest_1.expect)(synergies.length).toEqual(4);
const costSum = champions_1.champions
.filter((c) => c.synergies.includes(synergy_name_1.SynergyName.SupremeCells))
.reduce((sum, c) => sum + c.cost, 0);
(0, vitest_1.expect)(costSum).toEqual(4 + 3 + 2 + 1);
});
(0, vitest_1.test)("The Champ", () => {
const synergies = champions_1.champions
.flatMap((c) => c.synergies)
.filter((synergyName) => synergyName === synergy_name_1.SynergyName.TheChamp);
(0, vitest_1.expect)(synergies.length).toEqual(1);
const costSum = champions_1.champions
.filter((c) => c.synergies.includes(synergy_name_1.SynergyName.TheChamp))
.reduce((sum, c) => sum + c.cost, 0);
(0, vitest_1.expect)(costSum).toEqual(5);
});
(0, vitest_1.test)("The Crew", () => {
const synergies = champions_1.champions
.flatMap((c) => c.synergies)
.filter((synergyName) => synergyName === synergy_name_1.SynergyName.TheCrew);
(0, vitest_1.expect)(synergies.length).toEqual(4);
const costSum = champions_1.champions
.filter((c) => c.synergies.includes(synergy_name_1.SynergyName.TheCrew))
.reduce((sum, c) => sum + c.cost, 0);
(0, vitest_1.expect)(costSum).toEqual(1 + 2 + 1 + 3);
});
(0, vitest_1.test)("Wraith", () => {
const synergies = champions_1.champions
.flatMap((c) => c.synergies)
.filter((synergyName) => synergyName === synergy_name_1.SynergyName.Wraith);
(0, vitest_1.expect)(synergies.length).toEqual(6);
const costSum = champions_1.champions
.filter((c) => c.synergies.includes(synergy_name_1.SynergyName.Wraith))
.reduce((sum, c) => sum + c.cost, 0);
(0, vitest_1.expect)(costSum).toEqual(2 + 4 + 1 + 3 + 5 + 1);
});
(0, vitest_1.test)("Rosemother", () => {
const synergies = champions_1.champions
.flatMap((c) => c.synergies)
.filter((synergyName) => synergyName === synergy_name_1.SynergyName.Rosemother);
(0, vitest_1.expect)(synergies.length).toEqual(1);
const costSum = champions_1.champions
.filter((c) => c.synergies.includes(synergy_name_1.SynergyName.Rosemother))
.reduce((sum, c) => sum + c.cost, 0);
(0, vitest_1.expect)(costSum).toEqual(5);
});