12 lines
354 B
Markdown
12 lines
354 B
Markdown
---
|
|
description: Preferences for testing and mocks
|
|
globs: ["**/*_test.go", "e2e/**/*.go"]
|
|
---
|
|
|
|
# Testing Mocks
|
|
|
|
When writing or updating tests:
|
|
- Always prefer real code, a local version of a server (like `httptest`), etc., to static mocks.
|
|
- Prefer dependency injection if useful for testing.
|
|
- A mock implementation should be the absolute last resort.
|