Reverted boilerplate code fixes and applied review comments

Will now be handled by milkmaiden
This commit is contained in:
Bertie690 2025-04-28 22:18:49 -04:00
parent 06b9c9574d
commit aef5882b20

View File

@ -71,16 +71,15 @@ async function runInteractive() {
const fileNameAnswer = await promptFileName(typeAnswer.selectedOption); const fileNameAnswer = await promptFileName(typeAnswer.selectedOption);
const type = typeAnswer.selectedOption.toLowerCase(); const type = typeAnswer.selectedOption.toLowerCase();
// Convert fileName to kebab-case // Convert fileName from kebab-case or camelCase to snake_case
// Ex: "Cud Chew/Cud-Chew" --> "cud-chew"
const fileName = fileNameAnswer.userInput const fileName = fileNameAnswer.userInput
.replace(/([a-z])([A-Z])/g, "$1-$2") // Convert camelCase to kebab-case .replace(/-+/g, "_") // Convert kebab-case (dashes) to underscores
.replace(/\s+/g, "-") // Replace spaces with dashes .replace(/([a-z])([A-Z])/g, "$1_$2") // Convert camelCase to snake_case
.replace(/\s+/g, "_") // Replace spaces with underscores
.toLowerCase(); // Ensure all lowercase .toLowerCase(); // Ensure all lowercase
// Format the description for the test case
// Get proper english name for test names and data name for abilities/moves const formattedName = fileName.replace(/_/g, " ").replace(/\b\w/g, char => char.toUpperCase());
const formattedName = fileName.replace(/-/g, " ").replace(/\b\w/g, char => char.toUpperCase());
const attrName = fileName.replace(/-+/g, "_").toUpperCase(); // enum names are snake case, fullcaps
// Determine the directory based on the type // Determine the directory based on the type
let dir; let dir;
let description; let description;
@ -131,9 +130,9 @@ describe("${description}", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
game.override game.override
.moveset(Moves.${type === "move" ? attrName : "SPLASH"}) .moveset([ Moves.SPLASH ])
.ability(Abilities.${type === "ability" ? attrName : "BALL_FETCH"}) .ability(Abilities.BALL_FETCH)
.battleStyle("single") .battleType("single")
.disableCrits() .disableCrits()
.enemySpecies(Species.MAGIKARP) .enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.BALL_FETCH) .enemyAbility(Abilities.BALL_FETCH)