Skip to content

feat: add comprehensive test suite with Jest#20

Merged
tinsever merged 1 commit intov3-devfrom
feat/add-tests-v3
Dec 31, 2025
Merged

feat: add comprehensive test suite with Jest#20
tinsever merged 1 commit intov3-devfrom
feat/add-tests-v3

Conversation

@tinsever
Copy link
Owner

  • 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
Copy link

Copilot AI left a comment

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 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.

@tinsever tinsever merged commit f14ef88 into v3-dev Dec 31, 2025
6 checks passed
@tinsever tinsever deleted the feat/add-tests-v3 branch January 1, 2026 17:47
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