Repository navigation
Commit 89529bf
chore: remove dead code and tautological tests (#29)
* chore: remove dead code and tautological tests
Dead code (zero references anywhere, including tests):
- src/lib/ai/prompts/index.ts (165 lines) — prompt building moved
server-side to supabase/functions/_shared/prompts.ts
- useKeyboardShortcuts, useResolvedTheme hooks
- isUrlSafe (validateUrl is the live entry point)
- requireAdmin in _shared/auth.ts — admin/index.ts does its own
inline user_roles lookups
- getAppRedirectUrl in native.ts
- mockSparringResponse/mockSparringScore aliases
- buildSearchQueries wrapper — inlined the one-line .map into its
two callers, which were both tests
Tests that assert nothing about our code:
- example.test.ts: expect(true).toBe(true)
- utils.test.ts: 11 tests over cn(), a one-line clsx+tailwind-merge
pass-through — tested the libraries, not us
- providers.test.ts: 14 of 15 tests re-asserted that a static const
is still a static const; kept the duplicate-model-ID check, which
guards real routing behavior
- i18n.test.ts: "locale has keys" tautologies and a key-count check
subsumed by the bidirectional key-set comparisons
- export-utils-extended.test.ts: 6 "typeof x === function" tests
- pages/HistoryPage smoke tests asserting document.body is defined
- settings-store-branches: the `afterRehydrate(undefined)` call
existed only to hit an `if (!state) return` line
Preserved deliberately: setActiveEnv/IS_STAGING in supabase/env.ts
(reserved by plans/supabase-staging.md for the admin env switcher),
and security-hardening/runtime-contracts/vercel-deployment-config
tests, which guard invariants from PRs #26/#27.
Verified: 921 tests pass, lint clean, tsc clean, build succeeds,
coverage thresholds still met (statements 90.45/90, branches
82.91/80, functions 91.46/89, lines 94.04/90).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* test: give CI expect assertions room for lazy route chunks
The e2e suite runs against the Vite dev server, which transforms
lazily-imported route modules on demand. The first assertion after
navigating to a lazy route therefore races that transform waterfall.
Trace timings from the failing CI run on this branch:
22:16:35.139 GET /app/sparring (document)
22:16:38.463 SparringPage.tsx (+3.3s)
22:16:38.755 SparringSetup.tsx (+3.6s, owns the heading)
Against the 5s Playwright default, with two workers sharing a runner,
that overruns. The failure screenshot shows the heading rendered
correctly -- the budget simply expired first.
Raise the expect timeout to 15s under CI only, leaving local runs at
the 5s default so genuine hangs still surface quickly. No assertion is
weakened: every expectation still has to pass, it just gets a budget
that reflects what the dev server actually costs on a shared runner.
Pre-existing, not caused by the dead-code removal in this branch: PR
28 recorded the same test as flaky, and it reproduces on base 79b65ca
with these changes absent.
Verified under 12 busy-loop jobs on 8 cores, 18-test sample:
5s (control): 1 flaky, 17 passed
15s (fixed): 18 passed
Full suite on a clean machine: 124 passed, 0 flaky.
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent 79b65ca commit 89529bf
19 files changed
Lines changed: 13 additions & 533 deletions
File tree
- src
- hooks
- lib
- ai
- prompts
- providers
- validation
- test
- pages
- stores
- supabase/functions
- ai
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
| |||
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
511 | | - | |
512 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | 12 | | |
18 | 13 | | |
19 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | 228 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | 35 | | |
53 | 36 | | |
54 | 37 | | |
| |||
100 | 83 | | |
101 | 84 | | |
102 | 85 | | |
103 | | - | |
| 86 | + | |
104 | 87 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | 88 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | 89 | | |
113 | 90 | | |
114 | 91 | | |
| |||
124 | 101 | | |
125 | 102 | | |
126 | 103 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | 104 | | |
133 | 105 | | |
134 | 106 | | |
| |||
0 commit comments