WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@SgtPooki
Copy link
Collaborator

@SgtPooki SgtPooki commented Dec 9, 2025

migrates from jest to vitest (better mocking support, and better DX all around)

adds deal.service.spec.ts (unit tests for deal.service.ts)

adds github action to run unit tests.

Copilot AI review requested due to automatic review settings December 9, 2025 19:35
@SgtPooki SgtPooki self-assigned this Dec 9, 2025
@FilOzzy FilOzzy added this to FS Dec 9, 2025
@github-project-automation github-project-automation bot moved this to 📌 Triage in FS Dec 9, 2025
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 migrates the testing framework from Jest to Vitest, adds comprehensive unit tests for deal.service.ts, and implements a GitHub Action for running unit tests in CI. The migration improves developer experience with better mocking support and faster test execution, while maintaining full test coverage.

Key changes:

  • Complete migration from Jest to Vitest testing framework with appropriate configuration
  • New comprehensive unit test suite for DealService covering initialization, deal creation, and error handling scenarios
  • Updated test scripts in package.json and removed Jest-specific configuration files

Reviewed changes

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

Show a summary per file
File Description
vitest.config.ts New Vitest configuration for unit tests with coverage reporting via v8 provider
test/vitest-e2e.config.ts New Vitest configuration specifically for e2e tests
src/deal/deal.service.spec.ts Comprehensive unit tests for DealService with 100+ lines covering all major code paths
src/metrics/utils/time-window-parser.test.ts Migrated existing tests to Vitest with UTC date handling fixes
package.json Updated test scripts and dependencies, replacing Jest with Vitest
jest.config.js Removed Jest configuration (no longer needed)
test/jest-e2e.json Removed Jest e2e configuration (replaced by vitest-e2e.config.ts)
tsconfig.test.json Removed (no longer needed with Vitest)
biome.json Removed Jest global variables from linter configuration
pnpm-lock.yaml Updated dependencies reflecting Jest → Vitest migration

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

Copy link
Collaborator

@silent-cipher silent-cipher left a comment

Choose a reason for hiding this comment

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

Everything looks good to me overall. The only concern is the migration of test/app.e2e-spec.ts to vitest.

@github-project-automation github-project-automation bot moved this from 📌 Triage to ✔️ Approved by reviewer in FS Dec 10, 2025

- name: Run Biome
run: biome ci .
run: pnpm lint:check
Copy link
Collaborator

Choose a reason for hiding this comment

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

I just noticed this - switching from biome ci . to pnpm lint:check seems to skip formatting checks. It only runs linting, so formatting issues won’t get caught.
I tried running pnpm format locally and it updated three unformatted files.

Image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i'm thinking we should just use biome check since that runs both format and lint

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, we can do that but biome check feels more suited for local development, whereas biome ci is intended specifically for CI/CD workflows.

@SgtPooki
Copy link
Collaborator Author

The only concern is the migration of test/app.e2e-spec.ts to vitest.

@silent-cipher the e2e test isn't being ran anywhere today that I can see, and fails for me locally.. e2e seems broken anyway until we get #81 or similar local setup so e2e tests can be ran easily

Copy link
Collaborator Author

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

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

self review.. this should wait until #94 & #96 are merged.. i will handle the rebase

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

Labels

None yet

Projects

Status: ✔️ Approved by reviewer

Development

Successfully merging this pull request may close these issues.

3 participants