fix(14): revise plans based on checker feedback

This commit is contained in:
2026-04-04 12:09:49 +02:00
parent 88708f962a
commit 30ec9b92d1
5 changed files with 140 additions and 79 deletions

View File

@@ -156,7 +156,7 @@ If TypeScript complains about passing PGlite db to service functions that expect
let db: any; // Use any to accommodate PGlite/postgres-js type difference
```
**6. OAuth tests boolean conversion:**
**6. OAuth tests -- boolean conversion:**
If any OAuth test checks `used === 0` or `used === 1`, change to `used === false` or `used === true`.
After converting each file, run it individually:
@@ -166,7 +166,7 @@ bun test tests/services/item.service.test.ts
Fix any issues before moving to the next file.
</action>
<verify>
<automated>bun test tests/services/ 2>&1 | tail -5</automated>
<automated>bun test tests/services/ 2>&1; [ $? -eq 0 ] && echo "PASS" || echo "FAIL"</automated>
</verify>
<acceptance_criteria>
- Every service test file has `beforeEach(async () => { db = await createTestDb(); })`
@@ -181,7 +181,7 @@ Fix any issues before moving to the next file.
<task type="auto">
<name>Task 2: Convert all route tests + MCP test to async, run full suite</name>
<files>tests/routes/items.test.ts, tests/routes/categories.test.ts, tests/routes/threads.test.ts, tests/routes/setups.test.ts, tests/routes/auth.test.ts, tests/routes/oauth.test.ts, tests/routes/images.test.ts, tests/routes/params.test.ts, tests/mcp/tools.test.ts</files>
<read_first>tests/routes/items.test.ts, tests/routes/auth.test.ts, tests/mcp/tools.test.ts</read_first>
<read_first>tests/routes/items.test.ts, tests/routes/categories.test.ts, tests/routes/threads.test.ts, tests/routes/setups.test.ts, tests/routes/auth.test.ts, tests/routes/oauth.test.ts, tests/routes/images.test.ts, tests/routes/params.test.ts, tests/mcp/tools.test.ts</read_first>
<action>
Route tests typically create a test app with a test database injected. The pattern is usually:
@@ -207,7 +207,7 @@ async function createTestApp() {
1. Make the test app factory `async` and `await createTestDb()`
2. Make `beforeEach` async if it calls the factory
3. Route tests use `app.request()` which returns a Promise these should already be awaited. Verify each test awaits the response.
3. Route tests use `app.request()` which returns a Promise -- these should already be awaited. Verify each test awaits the response.
4. If any test does direct DB calls for setup/assertions, apply same async conversion as service tests
5. Make all test callbacks async
@@ -232,7 +232,7 @@ grep -rn "bun:sqlite\|drizzle-orm/bun-sqlite\|\.all()\|\.get()\|\.run()" tests/
Should return NO matches (except possibly string literals in test descriptions).
</action>
<verify>
<automated>bun test tests/ 2>&1 | tail -10</automated>
<automated>bun test tests/ 2>&1; [ $? -eq 0 ] && echo "PASS" || echo "FAIL"</automated>
</verify>
<acceptance_criteria>
- Every route test file has async `createTestApp` or async `beforeEach` with `await createTestDb()`
@@ -247,9 +247,9 @@ Should return NO matches (except possibly string literals in test descriptions).
</tasks>
<verification>
- `bun test tests/` ALL tests pass (exit code 0)
- `grep -rn "bun:sqlite\|drizzle-orm/bun-sqlite" tests/` NO matches
- `grep -rn "\.all()\b" tests/ | grep -v "describe\|it(" ` NO matches on DB calls (may appear in test descriptions)
- `bun test tests/` -- ALL tests pass (exit code 0)
- `grep -rn "bun:sqlite\|drizzle-orm/bun-sqlite" tests/` -- NO matches
- `grep -rn "\.all()\b" tests/ | grep -v "describe\|it(" ` -- NO matches on DB calls (may appear in test descriptions)
</verification>
<success_criteria>