Updated testing methodology to not create test scripts and just test in main code.

This commit is contained in:
2026-03-10 17:03:37 -07:00
parent 594c51faea
commit 52b699564e
4 changed files with 6 additions and 23 deletions

View File

@@ -101,18 +101,8 @@ Import-Module "$script:AppRoot\Modules\ProjectName.psm1" -Force
## Testing
- Use **Pester** for unit testing
- Always provide a Pester test file alongside new functions
- At minimum, test: happy path, expected failure cases, and edge cases
- Run tests with: `Invoke-Pester -Path .\Tests\ -Output Detailed`
```powershell
# Tests/Get-UserConfig.Tests.ps1
Describe "Get-UserConfig" {
It "Returns default config when file does not exist" { ... }
It "Loads config from valid .psd1 file" { ... }
}
```
- Do **not** create test files — I'll run the code directly to verify it works
- If asked to write tests, use **Pester** with `Invoke-Pester -Path .\Tests\ -Output Detailed`
## Comments

View File

@@ -11,8 +11,6 @@ ProjectName/
├── README.md
├── Modules/
│ └── ProjectName.psm1 # Shared functions, config loading, helpers
├── Tests/
│ └── *.Tests.ps1 # Pester test files
└── Release-Notes/
├── v1.0.md
└── v1.1.md
@@ -53,15 +51,12 @@ project-name/
├── routers/
│ ├── auth.py
│ └── [resource].py
── utils/
└── tests/
└── test_[resource].py
── utils/
```
**Rules:**
- `.env` is never committed — `.env.example` always is
- Each resource (users, items, etc.) gets its own model, schema, and router file
- Tests live inside `backend/app/tests/`
---

View File

@@ -137,10 +137,8 @@ services:
## Testing
- Use **pytest** with **pytest-asyncio** for async tests
- Always provide a test for each router endpoint at minimum (happy path + 1 failure case)
- Use a separate test database — never run tests against the real DB
- Run with: `pytest -v`
- Do **not** create test files — I'll run the code directly to verify it works
- If asked to write tests, use **pytest** with **pytest-asyncio**; use a separate test DB, never the real one
## Comments