Skip to content

Code Review and Performance Improvements#88

Merged
cahilfoley merged 3 commits intomainfrom
claude/code-improvements-011CUwdJtHHPReco7T6C28CL
Nov 9, 2025
Merged

Code Review and Performance Improvements#88
cahilfoley merged 3 commits intomainfrom
claude/code-improvements-011CUwdJtHHPReco7T6C28CL

Conversation

@cahilfoley
Copy link
Owner

  • Added vitest as the testing framework with full configuration
  • Created 130+ unit tests covering:
    • Utils: random, lerp, randomElement, getSize functions
    • Snowflake: initialization, updates, position wrapping, drawing
    • SnowfallCanvas: config management, snowflake lifecycle, animation
    • Hooks: useComponentSize, useSnowfallStyle, useDeepCompareEffect, useDeepMemo
  • Set up jsdom environment with Canvas and ResizeObserver mocks
  • Updated GitHub Actions workflow to run tests on PRs
  • Upgraded actions/checkout and actions/setup-node to v4
  • All tests passing (130 passed, 7 skipped due to timing constraints)

The test suite ensures code quality and prevents regressions in:

  • Snowflake physics and movement logic
  • Canvas rendering and cleanup
  • React hooks behavior
  • Configuration updates and validation

- Added vitest as the testing framework with full configuration
- Created 130+ unit tests covering:
  - Utils: random, lerp, randomElement, getSize functions
  - Snowflake: initialization, updates, position wrapping, drawing
  - SnowfallCanvas: config management, snowflake lifecycle, animation
  - Hooks: useComponentSize, useSnowfallStyle, useDeepCompareEffect, useDeepMemo
- Set up jsdom environment with Canvas and ResizeObserver mocks
- Updated GitHub Actions workflow to run tests on PRs
- Upgraded actions/checkout and actions/setup-node to v4
- All tests passing (130 passed, 7 skipped due to timing constraints)

The test suite ensures code quality and prevents regressions in:
- Snowflake physics and movement logic
- Canvas rendering and cleanup
- React hooks behavior
- Configuration updates and validation
- Remove deprecated useWorkspaces option from lerna.json (lerna v8+)
- Exclude test files from TypeScript compilation in tsconfig.json
- Update .npmignore to exclude test directory and vitest config from npm package

This fixes the CI build pipeline error and ensures test files are not
included in the compiled output or published package.
- Remove Node 16.x (EOL) and 18.x from test matrix
- Add Node 22.x (latest LTS)
- Focus on current and next LTS versions for build tooling compatibility
@cahilfoley cahilfoley merged commit 24f2435 into main Nov 9, 2025
3 checks passed
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.

2 participants