Skip to content

Commit ccdb6c4

Browse files
committed
Add comprehensive unit tests with vitest
- 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
1 parent 252fb40 commit ccdb6c4

9 files changed

Lines changed: 3915 additions & 207 deletions

File tree

.github/workflows/build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ jobs:
1919
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2020

2121
steps:
22-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v4
2323
- name: Use Node.js ${{ matrix.node-version }}
24-
uses: actions/setup-node@v2
24+
uses: actions/setup-node@v4
2525
with:
2626
node-version: ${{ matrix.node-version }}
2727
cache: 'npm'
2828
- run: npm ci
2929
- run: npx lerna run build
30+
- run: npx lerna run test

0 commit comments

Comments
 (0)