Skip to content

Add missing test infrastructure and comprehensive test suite - #13

Merged
frouaix merged 7 commits into
mainfrom
copilot/add-tests-directory
Feb 14, 2026
Merged

frouaix merged 7 commits into
mainfrom
copilot/add-tests-directory

Conversation

Copilot AI commented Feb 14, 2026 •

Copy link
Copy Markdown
Contributor

Investigation: Missing Tests Directory

Problem Analysis

  • Confirmed that tests are missing from the repository
  • Vitest is configured to look for tests in src/tests/ directory
  • The directory src/tests/ does not exist
  • Copilot instructions mention 325 tests but they are not in the codebase
  • Test infrastructure (vitest, testing libraries) is installed and configured

Root Cause

The src/tests/ directory referenced in vitest.config.ts does not exist in the repository. The copilot instructions describe a comprehensive test suite with 325 tests, but these tests are not present in the actual codebase.

Solution Implemented

  • Created the missing src/tests/ directory structure
  • Added setup file referenced in vitest config (src/tests/setup.ts)
  • Created comprehensive test file for bigHelpers module (84 passing tests)
  • Created TESTING.md documentation explaining how to run tests
  • Updated TESTING.md to use pnpm commands (project standard)
  • Clarified that tests are minimal, not comprehensive across the entire codebase
  • Added complete test coverage for all 19 bigHelpers functions
  • Verified all tests run successfully

Test Results

✓ src/tests/bigHelpers.test.ts (84 tests) 16ms
Test Files  1 passed (1)
Tests  84 passed (84)

Coverage Summary

All 19 exported functions from bigHelpers.ts now have comprehensive test coverage:

  • Basic operations (6 tests): toBig, add, subtract, multiply, divide
  • Formatting functions (12 tests): toCurrency, toNumber, toDollars, toPercent
  • Comparison functions (23 tests): max, min, isZero, isPositive, isNegative, compare
  • Math operations (24 tests): round, percent, sum, clamp
  • Financial calculations (19 tests): compoundGrowth, applyGrowth, effectiveTaxRate, parsePercent

Next Steps

The test infrastructure is now in place and working with comprehensive coverage for the bigHelpers module. Additional tests can be added for other modules following the pattern established in bigHelpers.test.ts.

Original prompt

I thought we had tests for this repo. Where are they?

The user has attached the following file paths as relevant context:

  • .github/copilot-instructions.md

Created from VS Code.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: frouaix <876178+frouaix@users.noreply.github.com>
Copilot AI changed the title [WIP] Add tests for repository functionality Add missing test infrastructure and initial test suite Feb 14, 2026
Copilot AI requested a review from frouaix February 14, 2026 20:10
@frouaix
frouaix marked this pull request as ready for review February 14, 2026 20:15
Copilot AI review requested due to automatic review settings February 14, 2026 20:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the missing Vitest test directory/setup referenced by vitest.config.ts, introduces an initial unit test suite for src/lib/bigHelpers.ts, and documents how to run/write tests in this repo.

Changes:

  • Added src/tests/setup.ts to satisfy Vitest setupFiles configuration.
  • Added src/tests/bigHelpers.test.ts with an initial set of unit tests for Big.js helper utilities.
  • Added TESTING.md describing test commands, structure, and examples.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/tests/setup.ts Introduces the Vitest setup file referenced by vitest.config.ts.
src/tests/bigHelpers.test.ts Adds initial unit tests for bigHelpers arithmetic/formatting helpers.
TESTING.md Documents testing workflow and conventions for adding new tests.

Comment thread src/tests/bigHelpers.test.ts Outdated
Comment thread TESTING.md
Comment thread TESTING.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

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

Comment thread TESTING.md Outdated
Comment thread TESTING.md Outdated
Comment thread TESTING.md Outdated
Comment thread TESTING.md Outdated
Comment thread TESTING.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Francois Rouaix <876178+frouaix@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread src/tests/bigHelpers.test.ts
Co-authored-by: frouaix <876178+frouaix@users.noreply.github.com>
Co-authored-by: frouaix <876178+frouaix@users.noreply.github.com>
Copilot AI changed the title Add missing test infrastructure and initial test suite Add missing test infrastructure and comprehensive test suite Feb 14, 2026
@frouaix
frouaix enabled auto-merge (squash) February 14, 2026 20:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@frouaix frouaix closed this Feb 14, 2026
auto-merge was automatically disabled February 14, 2026 21:07

Pull request was closed

@frouaix frouaix reopened this Feb 14, 2026
@frouaix
frouaix merged commit c8d79b5 into main Feb 14, 2026
6 checks passed
@frouaix
frouaix deleted the copilot/add-tests-directory branch February 14, 2026 21:08
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.

3 participants