From aef5882b202f538bccb420740d74deb63ee74270 Mon Sep 17 00:00:00 2001 From: Bertie690 Date: Mon, 28 Apr 2025 22:18:49 -0400 Subject: [PATCH] Reverted boilerplate code fixes and applied review comments Will now be handled by milkmaiden --- create-test-boilerplate.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/create-test-boilerplate.js b/create-test-boilerplate.js index 0eb20e2fbcc..d47b7c4afeb 100644 --- a/create-test-boilerplate.js +++ b/create-test-boilerplate.js @@ -71,16 +71,15 @@ async function runInteractive() { const fileNameAnswer = await promptFileName(typeAnswer.selectedOption); const type = typeAnswer.selectedOption.toLowerCase(); - // Convert fileName to kebab-case - // Ex: "Cud Chew/Cud-Chew" --> "cud-chew" + // Convert fileName from kebab-case or camelCase to snake_case const fileName = fileNameAnswer.userInput - .replace(/([a-z])([A-Z])/g, "$1-$2") // Convert camelCase to kebab-case - .replace(/\s+/g, "-") // Replace spaces with dashes + .replace(/-+/g, "_") // Convert kebab-case (dashes) to underscores + .replace(/([a-z])([A-Z])/g, "$1_$2") // Convert camelCase to snake_case + .replace(/\s+/g, "_") // Replace spaces with underscores .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 attrName = fileName.replace(/-+/g, "_").toUpperCase(); // enum names are snake case, fullcaps + const formattedName = fileName.replace(/_/g, " ").replace(/\b\w/g, char => char.toUpperCase()); // Determine the directory based on the type let dir; let description; @@ -131,9 +130,9 @@ describe("${description}", () => { beforeEach(() => { game = new GameManager(phaserGame); game.override - .moveset(Moves.${type === "move" ? attrName : "SPLASH"}) - .ability(Abilities.${type === "ability" ? attrName : "BALL_FETCH"}) - .battleStyle("single") + .moveset([ Moves.SPLASH ]) + .ability(Abilities.BALL_FETCH) + .battleType("single") .disableCrits() .enemySpecies(Species.MAGIKARP) .enemyAbility(Abilities.BALL_FETCH)