- Implement `grokkit testgen` for Go/Python/C/C++ files - Add language-specific prompts and test file conventions - Include backups, previews, auto-apply flag - Update README with docs and examples - Add unit tests for helper functions - Mark todo as completed
18 lines
679 B
Markdown
18 lines
679 B
Markdown
# `grokkit testgen [path...]`
|
|
**Description**: Generate comprehensive unit tests for Go files/packages using AI analysis of source code.
|
|
|
|
**Benefits**:
|
|
- Boost test coverage from current ~72% baseline automatically.
|
|
- Enforces modern table-driven tests with `t.Parallel()` matching codebase style (e.g., `internal/version/version_test.go`).
|
|
|
|
**High-level implementation**:
|
|
- Extract funcs/structs via `go/ast` or prompt with code snippets.
|
|
- Prompt Grok: "Generate table-driven tests for this Go code."
|
|
- Output `*_test.go`, create `.bak`, preview/apply like `edit`.
|
|
- Verify: `go test -v ./...` post-generation.
|
|
|
|
**CLI example**:
|
|
```
|
|
grokkit testgen internal/grok/client.go
|
|
```
|