Skip to content

Fix the health check service test typing - #1807

Merged
asteriscos merged 1 commit into
5.0.0from
bug/1806-fix-healthcheck-test-typing
Nov 27, 2026
Merged

asteriscos merged 1 commit into
5.0.0from
bug/1806-fix-healthcheck-test-typing

Conversation

@Desvelao

Copy link
Copy Markdown
Member

Description

Fixes the 5.0.0 bootstrap failure (tsc -b tsconfig.refs.json, TS2493/TS2339) caused by the unit test added in #1804, which breaks every dashboard package build.

Closes #1806

Proposed Changes

  • Assert the first http.get call in src/core/public/healthcheck/service.test.ts with toHaveBeenCalledWith('/api/healthcheck/internal', { query: undefined, asSystemRequest: undefined }) instead of indexing mock.calls[0][1], which does not type check because the mocked HttpHandler keeps only its last overload.
  • Test-only change; the runtime code is untouched.

Results and Evidence

tsc -b tsconfig.refs.json exits 0 and the healthcheck suite passes (17 passed, 1 skipped) in the dev container (Node 22.23.4).

Artifacts Affected

None.

Configuration Changes

None.

Documentation Updates

None.

Tests Introduced

None new; the existing test "sends a regular request by default" is rewritten to type check.

Review Checklist

  • Code changes reviewed
  • Relevant evidence provided
  • Tests cover the new functionality
  • Configuration changes documented
  • Developer documentation reflects the changes
  • Meets requirements and/or definition of done
  • No unresolved dependencies with other issues
  • PR is linked to the relevant issue(s)
  • Correct labels applied (e.g., no-changelog)

Assert the first http.get call with toHaveBeenCalledWith instead of
indexing mock.calls[0][1], which does not type check because the mocked
HttpHandler keeps only its last overload and breaks yarn osd bootstrap.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com>
@Desvelao Desvelao self-assigned this Nov 27, 2026
@Desvelao Desvelao linked an issue Nov 27, 2026 that may be closed by this pull request
@Desvelao
Desvelao marked this pull request as ready for review November 27, 2026 10:01
@asteriscos

Copy link
Copy Markdown
Member

@asteriscos

Copy link
Copy Markdown
Member

Packages finished building successfully.

@asteriscos
asteriscos merged commit a19f1e9 into 5.0.0 Nov 27, 2026
137 of 141 checks passed
@asteriscos
asteriscos deleted the bug/1806-fix-healthcheck-test-typing branch November 27, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5.0.0 package build fails in bootstrap: TS2493/TS2339

2 participants