Skip to content

Conversation

@tommie
Copy link
Contributor

@tommie tommie commented Jul 25, 2024

Adds Jest as a test framework and tests for JSON parsing.

Closes #646.

tommie added 2 commits July 25, 2024 09:30
JSON is a subset of YAML, making it redundant.
Makes tools into a function to be able to mock it.
It does not need to be exported.
@EndBug EndBug added the status: pinned Should not be labeled as stale label Aug 1, 2024
@EndBug EndBug requested a review from Copilot October 30, 2025 21:21
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 Jest-based unit testing infrastructure to the project and modifies the toolkit initialization to be lazy-loaded. The changes enable proper testing of utility functions that previously required GitHub Actions environment variables at module load time.

Key changes:

  • Converted toolkit initialization from eager to lazy loading to support testing
  • Removed redundant JSON parsing step from parseInputArray (YAML parser handles JSON)
  • Added Jest testing framework with configuration and CI integration

Reviewed Changes

Copilot reviewed 5 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tsconfig.json Changed rootDir to "." to support compiling test files
src/util.ts Refactored toolkit to lazy initialization and simplified parseInputArray to only use YAML parser
test/util.test.ts Added unit tests for parseInputArray function with environment setup
package.json Added jest dependencies and updated test scripts
jest.config.js Added Jest configuration for ts-jest
.husky/pre-commit Added test execution to pre-commit hook
.github/workflows/test.yml Added CI test job

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: pinned Should not be labeled as stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSON parsing is redundant

2 participants