feat: add comprehensive test suite with Jest#20
Merged
Conversation
Owner
tinsever
commented
Dec 31, 2025
- Add Jest test framework with 127 passing tests
- Add test coverage for all library modules:
- cache.js (100% coverage)
- noop.js (100% coverage)
- google-font-list.js (93% coverage)
- request.js (93% coverage)
- google-font.js
- system-font.js
- Add jest.config.js with coverage configuration
- Add test scripts: test, test:watch, test:coverage
- Add Jest test framework with 127 passing tests - Add test coverage for all library modules: - cache.js (100% coverage) - noop.js (100% coverage) - google-font-list.js (93% coverage) - request.js (93% coverage) - google-font.js - system-font.js - Add jest.config.js with coverage configuration - Add test scripts: test, test:watch, test:coverage
There was a problem hiding this comment.
Pull request overview
This PR adds a comprehensive Jest testing framework to the project with 127 passing tests covering all library modules. The test suite provides excellent coverage across cache, request, google-font, google-font-list, system-font, and noop modules, with most modules achieving 93-100% coverage.
Key Changes
- Added Jest 30.2.0 as a dev dependency with test, test:watch, and test:coverage scripts
- Created 6 test files covering all major library modules with comprehensive unit tests
- Added jest.config.js with coverage configuration excluding Windows-specific code
- Removed test/ from .gitignore to allow test files to be committed
Reviewed changes
Copilot reviewed 7 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| test/system-font.test.js | Comprehensive tests for SystemFont module including file operations, folder validation, and platform-specific installation paths |
| test/request.test.js | Tests for HTTP/HTTPS request handling, redirects, error handling, streaming functionality, and timeout behavior |
| test/noop.test.js | Simple but thorough tests for the noop utility function's error handling behavior |
| test/google-font.test.js | Tests for GoogleFont class including constructor, variant normalization, URL generation, and API methods |
| test/google-font-list.test.js | Extensive tests for font list operations including searching, filtering, cloning, and data population |
| test/cache.test.js | Tests for cache read/write operations, TTL validation, and error handling |
| package.json | Added test scripts and Jest as a dev dependency |
| jest.config.js | Jest configuration with node environment, coverage settings, and test pattern matching |
| .gitignore | Removed test/ directory exclusion to allow committing test files, added *.tar.gz |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.