fix: add GitContext type annotation to mock in generate.test.ts
The mockGitContext variable was declared without a type annotation, causing TypeScript to infer a narrow type from the initial assignment (status: "modified"). This made reassignment with status: "added" fail with TS2322. Adding the GitContext type allows all valid status values.
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { describe, expect, test, mock, beforeEach } from "bun:test"
|
||||
import type { GitContext } from "../types"
|
||||
|
||||
// Mock dependencies before importing the module under test
|
||||
|
||||
let mockGitContext = {
|
||||
let mockGitContext: GitContext = {
|
||||
branch: "main",
|
||||
recentCommits: ["abc1234 initial commit"],
|
||||
files: [
|
||||
|
||||
Reference in New Issue
Block a user