Commit c027045
committed
refactor(tests): migrate test suite and mock-builders to TypeScript
Migrates 44 mock-builders, 36 test files, 2 offline-support helpers, 1
test utility (BetterSqlite), and jest-setup from JS to TS. Adds
tsconfig.test.json so tests and mock-builders are type-checked (base
tsconfig still excludes them from the published build) and a
test:typecheck script.
Dependency changes:
- @types/jest: ^29.5.14 -> ^30.0.0
- jest: ^30.0.0 -> ^30.3.0
- @total-typescript/shoehorn: new devDependency (fromPartial<T>() for
type-safe partial mocks, replacing `as any` / `Record<string, any>`)
Caveats:
- tsconfig.test.json keeps noImplicitAny: false as a starting point;
tightening is follow-up work (Phase 5 of the migration plan).
- yarn test:typecheck exists but is not wired into CI yet.
Verification:
- yarn build passes
- yarn lint passes
- yarn test:unit shows only the pre-existing SQLite-isolation flake in
offline-support/index.test.ts (baseline had 5 failures; now 2 — no
regressions).1 parent b0db688 commit c027045
134 files changed
Lines changed: 1401 additions & 881 deletions
File tree
- package
- src
- __tests__/offline-support
- components
- Attachment/__tests__
- AutoCompleteInput/__tests__
- ChannelList/__tests__
- ChannelPreview/__tests__
- Channel/__tests__
- Chat/__tests__
- MessageInput/__tests__
- __snapshots__
- MessageList/__tests__
- __snapshots__
- Message/MessageItemView/__tests__
- __snapshots__
- Thread/__tests__
- __snapshots__
- mock-builders
- api
- event
- generator
- test-utils
- utils/__tests__
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | | - | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
| 131 | + | |
130 | 132 | | |
131 | 133 | | |
132 | | - | |
| 134 | + | |
133 | 135 | | |
134 | 136 | | |
135 | 137 | | |
| |||
154 | 156 | | |
155 | 157 | | |
156 | 158 | | |
157 | | - | |
| 159 | + | |
158 | 160 | | |
159 | 161 | | |
160 | 162 | | |
| |||
0 commit comments