-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
✅ test: add unit tests for compass module #10958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds a new Vitest test suite covering the StrCompressor/Compressor utilities in compass.ts, including sync/async compression and decompression, URL-safe base64 behavior, edge cases, and mocking of the underlying brotli-wasm dependency. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #10958 +/- ##
==========================================
+ Coverage 75.55% 80.33% +4.77%
==========================================
Files 667 981 +314
Lines 46377 67024 +20647
Branches 5971 10592 +4621
==========================================
+ Hits 35041 53841 +18800
- Misses 11336 13183 +1847
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
💻 Change Type
🔗 Related Issue
Part of ongoing test coverage improvements.
🔀 Description of Change
Added comprehensive unit tests for the
StrCompressorclass inpackages/utils/src/compass.ts.Summary:
packages/utils/src/compass.ts(String Compressor utility)compass.test.ts)Changes:
🧪 How to Test
Run the tests:
Test coverage includes:
Initialization and setup
Synchronous compression and decompression
Asynchronous compression and decompression
Round-trip data integrity (sync and async)
URL-safe base64 encoding (no +, /, or = characters)
Cross-method compatibility (sync compress + async decompress, etc.)
Edge cases: empty strings, Unicode characters, special characters, very long strings, JSON strings
Compression effectiveness with various input types
Tested locally
Added/updated tests
No tests needed
📸 Screenshots / Videos
N/A - Test coverage only, no UI changes.
📝 Additional Information
Module Processed:
packages/utils/src/compass.tsTest Approach:
brotli-wasmmodule to avoid WASM loading issues in test environmentbase64.test.tsandformat.test.tsFunctions tested:
init()- Instance initializationcompress()- Synchronous compression with URL-safe encodingdecompress()- Synchronous decompressioncompressAsync()- Asynchronous compressiondecompressAsync()- Asynchronous decompressionCompressorsingleton instance🤖 Generated with Claude Code
Summary by Sourcery
Tests: