Skip to content

Harden the test suite - #956

Merged
felladrin merged 5 commits into
mainfrom
fix/harden-test-suite
Aug 6, 2026
Merged

Harden the test suite#956
felladrin merged 5 commits into
mainfrom
fix/harden-test-suite

Conversation

@felladrin

@felladrin felladrin commented Aug 5, 2026

Copy link
Copy Markdown
Owner

What changed

New tests (4):

  • Unsubscribing twice (the node = 0 guard)
  • Unsubscribing another handler mid-publish
  • Subscribing mid-publish (documents that the new subscriber is reached in the current loop)
  • get() before anything is published on a store without initial value

Smoke test (6 tests):

CI improvements:

  • Node version matrix: 24, 26 instead of single lts/*

@felladrin
felladrin force-pushed the fix/harden-test-suite branch from 762316b to b16f23a Compare August 6, 2026 12:19
- Fix unsubscribe bug: repair both predecessor and successor pointers
  on removal so later unsubscribe never reads a stale reference.
  Keeps both subscribe and unsubscribe O(1).
- Replace weak "unsubscribe twice" test with two stronger tests:
  one that verifies double-unsubscribe doesn't clobber intervening
  subscriptions, and one that catches the adjacent-unsubscribe bug
- Add fail-fast: false to CI matrix so all Node versions run
- Remove dead fileURLToPath import and stale globals mapping from
  rollup config
- Remove inert ../main and ../immer from react externals
- Simplify smoke test build hook (remove unnecessary try/catch)

Fixes #934
@felladrin
felladrin force-pushed the fix/harden-test-suite branch from b16f23a to e7b0343 Compare August 6, 2026 12:24
jsdom@30 requires Node 22+, so Node 20 already fails at npm ci
(prepare script triggers rollup which can't load .ts config on
Node 20). Node 20 reached EOL in April 2025 anyway.

Fixes CI failure on PR #956.
@felladrin
felladrin marked this pull request as ready for review August 6, 2026 16:06
@felladrin
felladrin merged commit c79fc14 into main Aug 6, 2026
2 checks passed
@felladrin
felladrin deleted the fix/harden-test-suite branch August 6, 2026 16:06
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.

Harden the test suite

1 participant