Skip to content

test: cover Metric constructor validation - #821

Open
WilliamK112 wants to merge 1 commit into
prometheus:mainfrom
WilliamK112:test/metric-constructor-805
Open

test: cover Metric constructor validation#821
WilliamK112 wants to merge 1 commit into
prometheus:mainfrom
WilliamK112:test/metric-constructor-805

Conversation

@WilliamK112

Copy link
Copy Markdown

Summary

  • add direct tests for the shared Metric constructor validation contract
  • verify the valid path applies defaults, sorts labels, and calls reset()
  • include the required changelog entry

This is test-only and does not change runtime behavior.

Refs #805 (focused coverage improvement; intentionally does not close the broader issue)

Coverage

For lib/metric.js in the full suite:

  • statements/lines: 82.14% → 96.42%
  • branches: 78.26% → 95.65%

Testing

  • npm test — lint, Prettier, TypeScript, 30 suites and 588 tests pass
  • focused test on Node.js 22 — 5 tests pass
  • focused test on Node.js 24 — 5 tests pass
  • full suite and coverage on Node.js 26 — 588 tests pass

Signed-off-by: WilliamK112 <164879897+WilliamK112@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant