Replace `as any` mock fixtures in three app test files with shoehorn
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- react, typescript
Research direction
Open the three named test files and locate each partial mock using } as any and its eslint suppression. Replace the seven assertions with fromPartial({...}) from @total-typescript/shoehorn, then run yarn ratchet:update and verify the app/as-any and app/eslint-disable baselines decrease as described.
Written by the indexing model from the issue text.
Description
Three test files added in #2802, #2816 and #2817 build partial mock objects with } as any and an // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion above each:
| file | hatches |
|---|---|
packages/app/src/components/__tests__/MetricTableModelForm.test.tsx |
4 |
packages/app/src/components/__tests__/DBTimeChart.test.tsx |
2 |
packages/app/src/components/__tests__/DBRowSidePanel.viewTraceTimeFilter.test.tsx |
1 |
These are the case @total-typescript/shoehorn is for: fromPartial({...}) gives the same brevity while still type-checking the fields you do set, so a renamed or retyped field breaks the test instead of sailing through the assertion.
Swapping them lets the ratchet baseline in scripts/ci/ratchet-baseline.json come back down (app/as-any 215 → 208, app/eslint-disable 143 → 136) via yarn ratchet:update.
Noticed while re-baselining the ratchet in #2661.
- Dominant language
- TypeScript
- Stars
- 9.9k
- Forks
- 471
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 117
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hyperdxio/hyperdx
-
enhancement external good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Trace source: document spanLinksValueExpression in the v2 sources external API (OpenAPI parity) Open
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
count_distinct aggFn on metric tiles ignores valueExpression, always counts distinct metric Values Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
enhancement external
Difficulty 4/5 3-5 days Newbie friendliness 48/100
All issues in hyperdxio/hyperdx
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
fullcalendar/fullcalendar#8106 ·