Skip to content

test: tighten any types in spec mocks to Mocked<T>#5008

Merged
mengw15 merged 4 commits intoapache:mainfrom
Ma77Ball:fix/tightenAnnotations
May 10, 2026
Merged

test: tighten any types in spec mocks to Mocked<T>#5008
mengw15 merged 4 commits intoapache:mainfrom
Ma77Ball:fix/tightenAnnotations

Conversation

@Ma77Ball
Copy link
Copy Markdown
Contributor

@Ma77Ball Ma77Ball commented May 10, 2026

What changes were proposed in this PR?

  • Replace let mockX: any; declarations in 13 active spec files with Mocked<T> from Vitest.
  • Replace {...} as any mock-literal casts with as unknown as Mocked<T> (or the appropriate concrete type for component property assignments and partial fixtures).
  • Replace seen: any[] accumulators in preset.service.spec.ts with the actual stream event types.
  • Skip the two pre-existing out-of-scope patterns: (svc as any).privateField private-member access and as any as joint.dia.Link JointJS partial-mocks.

Any related issues, documentation, or discussions?

Closes: #4867

How was this PR tested?

  • tsc --project src/tsconfig.spec.json --noEmit passes with no errors.
  • No runtime test behavior changed — only type annotations and casts.

Was this PR authored or co-authored using generative AI tooling?

Co-authored with Claude Opus 4.7 in compliance with ASF

@github-actions github-actions Bot added fix frontend Changes related to the frontend GUI labels May 10, 2026
@Ma77Ball Ma77Ball changed the title test: tighten any types in spec mocks to Mocked<T> test: tighten any types in spec mocks to Mocked<T> May 10, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.36%. Comparing base (c93c8f7) to head (eb95c45).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5008      +/-   ##
============================================
+ Coverage     43.35%   43.36%   +0.01%     
- Complexity     2182     2183       +1     
============================================
  Files          1035     1035              
  Lines         38818    38814       -4     
  Branches       4061     4061              
============================================
+ Hits          16830    16833       +3     
+ Misses        20932    20926       -6     
+ Partials       1056     1055       -1     
Flag Coverage Δ *Carryforward flag
access-control-service 39.53% <ø> (-0.35%) ⬇️ Carriedforward from 410c700
agent-service 33.72% <ø> (ø) Carriedforward from 410c700
amber 43.23% <ø> (+0.02%) ⬆️ Carriedforward from 410c700
computing-unit-managing-service 0.00% <ø> (ø) Carriedforward from 410c700
config-service 0.00% <ø> (ø) Carriedforward from 410c700
file-service 32.18% <ø> (+0.08%) ⬆️ Carriedforward from 410c700
frontend 35.17% <ø> (ø)
python 88.90% <ø> (ø) Carriedforward from 410c700
workflow-compiling-service 47.72% <ø> (ø) Carriedforward from 410c700

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@chenlica chenlica requested a review from mengw15 May 10, 2026 07:10
@chenlica
Copy link
Copy Markdown
Contributor

@mengw15 Please review this PR.

@mengw15
Copy link
Copy Markdown
Contributor

mengw15 commented May 10, 2026

@Ma77Ball Does this PR completely finish the issue? I saw in the issue it says "~80 remain". If not, maybe we want to change the "Closes issue"

Copy link
Copy Markdown
Contributor

@mengw15 mengw15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Ma77Ball
Copy link
Copy Markdown
Contributor Author

Ma77Ball commented May 10, 2026

@Ma77Ball Does this PR completely finish the issue? I saw in the issue it says "~80 remain". If not, maybe we want to change the "Closes issue"

@mengw15 Yes, this does finish the issue. The remaining spec files use any in a way that falls in the Out of Scope section of the issue.

@mengw15 mengw15 merged commit 23969c7 into apache:main May 10, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tighten remaining any annotations in spec files

4 participants