Skip to content

docs: document numeric option units and accept Date for logs since - #1627

Open
dieterstemmet wants to merge 1 commit into
testcontainers:mainfrom
dieterstemmet:docs/jsdoc-units-and-logs-since-date
Open

dieterstemmet wants to merge 1 commit into
testcontainers:mainfrom
dieterstemmet:docs/jsdoc-units-and-logs-since-date

Conversation

@dieterstemmet

Copy link
Copy Markdown

Summary

  • Add JSDoc units for sizes and durations (ResourcesQuota, HealthCheck, stop/restart/compose timeouts, wait-strategy timeouts, shared memory bytes).
  • Accept Date as well as Unix seconds for logs({ since }), converting via toUnixSeconds.
  • Warn in JSDoc that millisecond values such as Date.now() are far in the future for Docker's second-based filter.

Fixes #1542.

Test plan

  • npx vitest run packages/testcontainers/src/common/time.test.ts
  • Optional Docker: generic-container-logs Date since case
  • Hover JSDoc in an editor on withResourcesQuota, withSharedMemorySize, logs, and health-check fields

Verified

  • npx vitest run packages/testcontainers/src/common/time.test.ts: 16 passed
  • dryer on changed logic paths: no duplicate candidates
  • crapper --no-coverage on changed logic paths: toUnixSeconds CC 2 (under CRAP 10)
  • mutator --no-coverage on packages/testcontainers/src/common/time.ts: 100% (3/3 killed, 0 survived)

JSDoc every size/duration field that was unit-ambiguous, and let
logs({ since }) take a Date as well as Unix seconds.

Fixes testcontainers#1542

This branch has not been deployed

No deployments
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.

Document and align the units of sizes and durations

1 participant