-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
✅ test: add unit tests for Compass string compressor #10615
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
Added comprehensive unit tests for the StrCompressor class in packages/utils/src/compass.ts covering: - Synchronous compress/decompress operations - Asynchronous compress/decompress operations - URL-safe base64 encoding/decoding - Cross-method compatibility - Edge cases (empty strings, unicode, large data, binary data) - Round-trip encoding/decoding verification 32 test cases added with 100% coverage of the module's public API. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds a new Jest test suite for the Compass StrCompressor to exercise all sync/async compression/decompression paths, URL-safe base64 helpers, initialization logic, and singleton behavior using a mocked brotli-wasm dependency for deterministic coverage. 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 #10615 +/- ##
==========================================
+ Coverage 80.67% 80.68% +0.01%
==========================================
Files 971 972 +1
Lines 66059 66100 +41
Branches 8739 10156 +1417
==========================================
+ Hits 53292 53333 +41
Misses 12767 12767
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Summary
StrCompressorclass inpackages/utils/src/compass.tsChanges
Module Processed
packages/utils/src/compass.tsTest Coverage
Functions tested:
compress()- Synchronous string compressiondecompress()- Synchronous string decompressioncompressAsync()- Asynchronous string compressiondecompressAsync()- Asynchronous string decompressionurlSafeBase64Encode()- URL-safe base64 encoding (private)urlSafeBase64Decode()- URL-safe base64 decoding (private)init()- WASM module initializationCompressorsingleton instanceCoverage type:
Unit tests with mocked brotli-wasm dependency
Test approach:
Test categories:
🤖 Generated with Claude Code
Summary by Sourcery
Add comprehensive unit tests for the Compass string compressor utilities to validate compression, decompression, initialization, and singleton behavior using a mocked brotli-WASM dependency.
Tests: