Skip to content

feature(test): add tests using Antigravity and Gemini 3 Pro#20

Closed
f wants to merge 2 commits intomasterfrom
feature/tests
Closed

feature(test): add tests using Antigravity and Gemini 3 Pro#20
f wants to merge 2 commits intomasterfrom
feature/tests

Conversation

@f
Copy link
Owner

@f f commented Nov 18, 2025

Added tests using Google's new Antigravity IDE with Gemini 3 Pro model.

Copilot AI review requested due to automatic review settings November 18, 2025 18:26
@f
Copy link
Owner Author

f commented Nov 18, 2025

@copilot Write a better description.

Copy link
Contributor

Copilot AI commented Nov 18, 2025

@f I've opened a new pull request, #21, to work on those changes. Once the pull request is ready, I'll request review from you.

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 test suite using Vitest 3.2.4 for the git-rewrite-commits project. The changes include configuration setup, unit tests for provider classes (OpenAI and Ollama), integration tests for the main GitCommitRewriter class, and end-to-end CLI tests. Note that despite the PR title mentioning "Antigravity IDE" and "Gemini 3 Pro", these technologies are not referenced anywhere in the actual code changes - the PR simply adds standard Vitest-based testing infrastructure.

Key changes:

  • Added Vitest configuration and test script to enable test execution
  • Implemented comprehensive test coverage for OpenAI and Ollama providers with mocked dependencies
  • Added tests for the main GitCommitRewriter class functionality including commit quality assessment and staged change generation

Reviewed Changes

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

Show a summary per file
File Description
vitest.config.ts Adds Vitest configuration with Node environment and test file glob pattern
tests/providers/openai.test.ts Unit tests for OpenAIProvider with mocked OpenAI SDK
tests/providers/ollama.test.ts Unit tests for OllamaProvider with mocked fetch calls
tests/index.test.ts Integration tests for GitCommitRewriter class functionality
tests/cli.e2e.test.ts End-to-end tests for CLI commands and git repository integration
src/providers/index.ts Changes export to export type for AIProvider interface and removes trailing whitespace
package.json Adds vitest dependency and test script, reorders dependencies alphabetically
package-lock.json Updates lockfile with vitest and related dependencies

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

try {
await runCli('--provider openai', process.cwd(), { ...process.env, OPENAI_API_KEY: '' });
// Should fail
expect(true).toBe(false);
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

Using expect(true).toBe(false) as a way to fail the test is unclear and could be confusing. Consider using expect.fail() or throw new Error('Expected to throw') to make the intent more explicit.

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

"tsx": "^4.6.2",
"typescript": "^5.3.2",
"tsx": "^4.6.2"
"vitest": "^3.2.4"
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

Vitest 3.2.4 requires Node.js ^20.19.0 || >=22.12.0 (via its vite 7.x dependency), but this package specifies "node": ">=16.0.0" in its engines field (line 40). This version incompatibility will cause installation or runtime failures. Consider using an older version of vitest that supports Node.js 16+ (such as vitest 1.x or 2.x), or update the minimum Node.js requirement.

Suggested change
"vitest": "^3.2.4"
"vitest": "^2.4.5"

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,85 @@
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

Unused import afterEach.

Suggested change
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { describe, it, expect, vi, beforeEach } from 'vitest';

Copilot uses AI. Check for mistakes.

describe('GitCommitRewriter', () => {
const mockExecSync = vi.mocked(execSync);
const mockFs = vi.mocked(fs);
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

Unused variable mockFs.

Suggested change
const mockFs = vi.mocked(fs);

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI commented Nov 18, 2025

@f I've opened a new pull request, #22, to work on those changes. Once the pull request is ready, I'll request review from you.

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