Skip to content

Add unit tests with vitest - #3

Merged
0x80 merged 6 commits into
mainfrom
thijs/1219-add-unit-tests
Dec 19, 2025
Merged

0x80 merged 6 commits into
mainfrom
thijs/1219-add-unit-tests

Conversation

@0x80

@0x80 0x80 commented Dec 19, 2025

Copy link
Copy Markdown
Owner

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.

0x80 added 4 commits December 19, 2025 15:34
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.
Copilot AI review requested due to automatic review settings December 19, 2025 14:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread .github/workflows/checks.yml

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread src/process-in-chunks.test.ts Outdated
The test now measures max concurrent items instead of asserting
on a mathematical constant that always passes.
@0x80
0x80 merged commit 70abf2b into main Dec 19, 2025
5 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