Browse Source

run with pnpm and add to readme

Mark IJbema 4 months ago
parent
commit
a06916a4d7
2 changed files with 20 additions and 1 deletions
  1. 18 0
      src/test-llm-autocompletion/README.md
  2. 2 1
      src/test-llm-autocompletion/package.json

+ 18 - 0
src/test-llm-autocompletion/README.md

@@ -52,10 +52,28 @@ pnpm run test --skip-approval
 # Run a single test
 pnpm run test closing-brace
 
+# Clean up orphaned approval files
+pnpm run clean
+
 # Combine flags
 pnpm run test --verbose --skip-approval
 ```
 
+### Clean Command
+
+The `clean` command removes approval files for test cases that no longer exist:
+
+```bash
+pnpm run clean
+```
+
+This is useful when you've deleted or renamed test cases and want to clean up the corresponding approval files. The command will:
+
+- Scan all approval files in the `approvals/` directory
+- Check if each approval corresponds to an existing test case
+- Remove approvals for test cases that no longer exist
+- Report how many files were cleaned
+
 ### Skip Approval Mode
 
 Use `--skip-approval` (or `-sa`) to run tests in CI/CD or when you want to avoid interactive prompts:

+ 2 - 1
src/test-llm-autocompletion/package.json

@@ -6,7 +6,8 @@
 	"scripts": {
 		"test": "tsx runner.ts",
 		"test:verbose": "tsx runner.ts --verbose",
-		"test:fim": "tsx runner.ts --strategy \"FIM Codestral\""
+		"test:fim": "tsx runner.ts --strategy \"FIM Codestral\"",
+		"clean": "tsx runner.ts clean"
 	},
 	"dependencies": {
 		"@anthropic-ai/sdk": "^0.51.0",