Fix inconsistent it vs test in specs

Fixes #860
This commit is contained in:
kvan7
2026-02-28 08:20:36 -06:00
parent 9f28b7b60c
commit 4fe1d178c2
5 changed files with 36 additions and 36 deletions
+3 -3
View File
@@ -1,15 +1,15 @@
import { expect, test } from "vitest";
import { expect, it } from "vitest";
import { init } from "@/assets/data";
import { setupTests } from "@specs/vitest.setup";
function sum(a: number, b: number) {
return a + b;
}
test("adds 1 + 2 to equal 3", () => {
it("adds 1 + 2 to equal 3", () => {
expect(sum(1, 2)).toBe(3);
});
test("init", async () => {
it("init", async () => {
setupTests();
await init("en");
});
+13 -13
View File
@@ -1,5 +1,5 @@
import { magicBasetype } from "@/parser/magic-name";
import { beforeEach, describe, expect, test } from "vitest";
import { beforeEach, describe, expect, it } from "vitest";
import { setupTests } from "@specs/vitest.setup";
import { init } from "@/assets/data";
@@ -8,19 +8,19 @@ describe("Check Magic Name (en)", () => {
setupTests();
await init("en");
});
test("Should parse normal name", () => {
it("Should parse normal name", () => {
const name = "Rattling Sceptre";
expect(magicBasetype(name)).toBe("Rattling Sceptre");
});
test("Should parse magic name with suffix", () => {
it("Should parse magic name with suffix", () => {
const name = "Cultist Greathammer of Nourishment";
expect(magicBasetype(name)).toBe("Cultist Greathammer");
});
test("Should parse magic name with prefix", () => {
it("Should parse magic name with prefix", () => {
const name = "Pulsing Antler Focus";
expect(magicBasetype(name)).toBe("Antler Focus");
});
test("Should parse magic name with prefix and suffix", () => {
it("Should parse magic name with prefix and suffix", () => {
const name = "Reaver's Temple Maul of Stunning";
expect(magicBasetype(name)).toBe("Temple Maul");
});
@@ -31,19 +31,19 @@ describe("Check Magic Name (cmn-Hant)", () => {
setupTests({ language: "cmn-Hant" });
await init("cmn-Hant");
});
test("Should parse normal name", () => {
it("Should parse normal name", () => {
const name = "雜響權杖";
expect(magicBasetype(name)).toBe("雜響權杖");
});
test("Should parse magic name with suffix", () => {
it("Should parse magic name with suffix", () => {
const name = "營養之教徒巨錘";
expect(magicBasetype(name)).toBe("教徒巨錘");
});
test("Should parse magic name with prefix", () => {
it("Should parse magic name with prefix", () => {
const name = "脈衝的靈鹿法器";
expect(magicBasetype(name)).toBe("靈鹿法器");
});
test("Should parse magic name with prefix and suffix", () => {
it("Should parse magic name with prefix and suffix", () => {
const name = "掠奪者的擊暈之神殿重錘";
expect(magicBasetype(name)).toBe("神殿重錘");
});
@@ -54,19 +54,19 @@ describe("Check Magic Name (cmn-Hant) when UI returns english name", () => {
setupTests({ language: "cmn-Hant" });
await init("cmn-Hant");
});
test("Should parse normal name", () => {
it("Should parse normal name", () => {
const name = "Rattling Sceptre";
expect(magicBasetype(name)).toBe("Rattling Sceptre");
});
test("Should parse magic name with suffix", () => {
it("Should parse magic name with suffix", () => {
const name = "Cultist Greathammer of Nourishment";
expect(magicBasetype(name)).toBe("Cultist Greathammer");
});
test("Should parse magic name with prefix", () => {
it("Should parse magic name with prefix", () => {
const name = "Pulsing Antler Focus";
expect(magicBasetype(name)).toBe("Antler Focus");
});
test("Should parse magic name with prefix and suffix", () => {
it("Should parse magic name with prefix and suffix", () => {
const name = "Reaver's Temple Maul of Stunning";
expect(magicBasetype(name)).toBe("Temple Maul");
});
+8 -8
View File
@@ -1,6 +1,6 @@
import { CLIENT_STRINGS as _$ } from "@/assets/data";
import { __testExports } from "@/parser/Parser";
import { beforeEach, describe, expect, it, test } from "vitest";
import { beforeEach, describe, expect, it } from "vitest";
import { setupTests } from "@specs/vitest.setup";
import {
ArmourHighValueRareItem,
@@ -22,7 +22,7 @@ describe("itemTextToSections", () => {
setupTests();
await init("en");
});
test("empty string should not throw", () => {
it("empty string should not throw", () => {
expect(() => __testExports.itemTextToSections("")).not.toThrow();
});
@@ -46,7 +46,7 @@ describe("parseWeapon", () => {
setupTests();
await init("en");
});
test("Magic Weapon", () => {
it("Magic Weapon", () => {
const sections = __testExports.itemTextToSections(MagicItem.rawText);
const parsedItem = {} as ParsedItem;
@@ -59,7 +59,7 @@ describe("parseWeapon", () => {
expect(parsedItem.weaponCRIT).toBe(MagicItem.weaponCRIT);
expect(parsedItem.weaponRELOAD).toBe(MagicItem.weaponRELOAD);
});
test("Rare Weapon", () => {
it("Rare Weapon", () => {
const sections = __testExports.itemTextToSections(RareItem.rawText);
const parsedItem = {} as ParsedItem;
@@ -72,7 +72,7 @@ describe("parseWeapon", () => {
expect(parsedItem.weaponCRIT).toBe(RareItem.weaponCRIT);
expect(parsedItem.weaponRELOAD).toBe(RareItem.weaponRELOAD);
});
test("High Damage Rare Weapon", () => {
it("High Damage Rare Weapon", () => {
const sections = __testExports.itemTextToSections(
HighDamageRareItem.rawText,
);
@@ -95,7 +95,7 @@ describe("parseArmour", () => {
setupTests();
await init("en");
});
test("Normal Armour", () => {
it("Normal Armour", () => {
const sections = __testExports.itemTextToSections(NormalItem.rawText);
const parsedItem = {} as ParsedItem;
@@ -108,7 +108,7 @@ describe("parseArmour", () => {
expect(parsedItem.quality).toBe(NormalItem.quality);
expect(parsedItem.armourBLOCK).toBe(NormalItem.armourBLOCK);
});
test("Unique Armour", () => {
it("Unique Armour", () => {
const sections = __testExports.itemTextToSections(UniqueItem.rawText);
const parsedItem = {} as ParsedItem;
@@ -121,7 +121,7 @@ describe("parseArmour", () => {
expect(parsedItem.quality).toBe(UniqueItem.quality);
expect(parsedItem.armourBLOCK).toBe(UniqueItem.armourBLOCK);
});
test("High Armour Rare", () => {
it("High Armour Rare", () => {
const sections = __testExports.itemTextToSections(
ArmourHighValueRareItem.rawText,
);
+9 -9
View File
@@ -1,4 +1,4 @@
import { beforeEach, describe, expect, test } from "vitest";
import { beforeEach, describe, expect, it } from "vitest";
import { setupTests } from "@specs/vitest.setup";
import { __testExports, parseClipboard } from "@/parser/Parser";
import {
@@ -15,19 +15,19 @@ describe("isUncutSkillGem", () => {
setupTests();
await init("en");
});
test("FIXED so should now be false for uncut skill gem", () => {
it("FIXED so should now be false for uncut skill gem", () => {
const sections = __testExports.itemTextToSections(UncutSkillGem.rawText);
expect(__testExports.isUncutSkillGem(sections[0])).toBeFalsy();
});
test("FIXED so should now be false for uncut spirit gem", () => {
it("FIXED so should now be false for uncut spirit gem", () => {
const sections = __testExports.itemTextToSections(UncutSpiritGem.rawText);
expect(__testExports.isUncutSkillGem(sections[0])).toBeFalsy();
});
test("FIXED so should now be false for uncut skill gem", () => {
it("FIXED so should now be false for uncut skill gem", () => {
const sections = __testExports.itemTextToSections(UncutSupportGem.rawText);
expect(__testExports.isUncutSkillGem(sections[0])).toBeFalsy();
});
test("should return false for any other item", () => {
it("should return false for any other item", () => {
const sections = __testExports.itemTextToSections(RareItem.rawText);
expect(__testExports.isUncutSkillGem(sections[0])).toBe(false);
});
@@ -38,19 +38,19 @@ describe("Uncut gems parse correctly", () => {
setupTests();
await init("en");
});
test("should parse uncut skill gem", () => {
it("should parse uncut skill gem", () => {
const result = parseClipboard(UncutSkillGem.rawText).unwrapOr(null);
expect(result).not.toBeNull();
expect(result!.category).toBe(UncutSkillGem.category);
expect(result!.gemLevel).toBeUndefined();
});
test("should parse uncut spirit gem", () => {
it("should parse uncut spirit gem", () => {
const result = parseClipboard(UncutSpiritGem.rawText).unwrapOr(null);
expect(result).not.toBeNull();
expect(result!.category).toBe(UncutSpiritGem.category);
expect(result!.gemLevel).toBeUndefined();
});
test("should parse uncut support gem", () => {
it("should parse uncut support gem", () => {
const result = parseClipboard(UncutSupportGem.rawText).unwrapOr(null);
expect(result).not.toBeNull();
expect(result!.category).toBe(UncutSupportGem.category);
@@ -63,7 +63,7 @@ describe("Create Filter for uncut gems", () => {
setupTests();
await init("en");
});
test.each([
it.each([
{ gem: UncutSkillGem },
{ gem: UncutSpiritGem },
{ gem: UncutSupportGem },
+3 -3
View File
@@ -1,4 +1,4 @@
import { beforeEach, describe, expect, test } from "vitest";
import { beforeEach, describe, expect, it } from "vitest";
import { setupTests } from "../vitest.setup";
import {
__testExports,
@@ -17,7 +17,7 @@ describe("augmentsToLookup", () => {
await init("en");
});
test("empty list should not throw", () => {
it("should not throw with empty list", () => {
expect(() => __testExports.augmentsToLookup([])).not.toThrow();
});
// Currently disabled
@@ -27,7 +27,7 @@ describe("augmentsToLookup", () => {
// });
// expect(AUGMENT_DATA_BY_AUGMENT["Iron Rune"].length).toBe(3);
// });
test("Random stats should be present", () => {
it("Random stats should be present", () => {
expect(STAT_BY_REF("Adds # to # Physical Damage")).toBeTruthy();
expect(STAT_BY_REF("Adds # to # Lightning Damage")).toBeTruthy();
expect(STAT_BY_REF("#% to Fire Resistance")).toBeTruthy();