Repository navigation
Add unit tests with vitest - #3
Conversation
Adds 18 tests covering processInChunks and processInChunksByChunk including basic functionality, chunking behavior, error handling, and throttling.
Adds 8 new tests for the noThrow option covering ProcessResult return type, partial results, unique error message collection, and handling of all items/chunks failing.
There was a problem hiding this comment.
Pull request overview
This PR adds a comprehensive vitest test suite for the processInChunks and processInChunksByChunk functions, bringing robust test coverage to the codebase. The tests validate core functionality, chunking behavior, error handling (both throwing and non-throwing modes), and throttling with fake timers.
Key Changes:
- Adds 24 unit tests using vitest covering all major code paths
- Includes vitest as a dev dependency
- Minor formatting improvements to comments and documentation
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/process-in-chunks.test.ts | New comprehensive test suite with 24 tests covering processInChunks and processInChunksByChunk functions |
| src/utils/is-empty.ts | Comment formatting improvement (line break adjustment) |
| README.md | Minor formatting fix in parameter documentation |
| pnpm-lock.yaml | Dependency updates for vitest and related test infrastructure |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The test now measures max concurrent items instead of asserting on a mathematical constant that always passes.
Adds vitest for unit testing with 24 tests covering processInChunks and processInChunksByChunk functions. Tests include basic functionality, chunking behavior, throttling with fake timers, default error handling (throwing), and the noThrow option for graceful error collection with partial results.