Skip to content

test: add unit tests for dispatch-series helper functions#190

Merged
thymikee merged 2 commits intocallstackincubator:mainfrom
JSweet314:test/add-dispatch-series-unit-tests
Mar 6, 2026
Merged

test: add unit tests for dispatch-series helper functions#190
thymikee merged 2 commits intocallstackincubator:mainfrom
JSweet314:test/add-dispatch-series-unit-tests

Conversation

@JSweet314
Copy link
Contributor

Summary

  • Add unit tests for all exported functions in src/core/dispatch-series.ts
  • Cover requireIntInRange, clampIosSwipeDuration, shouldUseIosTapSeries, shouldUseIosDragSeries,
    computeDeterministicJitter, and runRepeatedSeries
  • 29 tests total covering boundary values, error cases, and behavioral expectations

Validation

  • pnpm node --test src/core/__tests__/dispatch-series.test.ts → 29/29 pass
ℹ tests 29
ℹ suites 0
ℹ pass 29
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 234.259217

Copilot AI review requested due to automatic review settings March 6, 2026 15:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new unit test suite to validate the behavior of exported helpers in src/core/dispatch-series.ts, improving confidence in argument validation, iOS gesture-series selection logic, deterministic jitter, and repeated-series execution.

Changes:

  • Adds unit tests for requireIntInRange, clampIosSwipeDuration, shouldUseIosTapSeries, shouldUseIosDragSeries
  • Adds unit tests for computeDeterministicJitter pattern behavior
  • Adds unit tests for runRepeatedSeries ordering, pause behavior, and error propagation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@thymikee
Copy link
Contributor

thymikee commented Mar 6, 2026

cool! is this something we have requested in issues or just random finding?

@JSweet314
Copy link
Contributor Author

cool! is this something we have requested in issues or just random finding?

Random finding after exploring the codebase - noticed a few little gaps in test coverage and these pure functions were an easy add.

@JSweet314
Copy link
Contributor Author

@thymikee if there is a "good first issue" for new contributors that would be useful to the project please let me know.

@thymikee thymikee merged commit 21b6b61 into callstackincubator:main Mar 6, 2026
6 of 7 checks passed
@thymikee
Copy link
Contributor

thymikee commented Mar 6, 2026

some refactorings should be good first issues :)

@thymikee
Copy link
Contributor

thymikee commented Mar 6, 2026

thank you!

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.

3 participants