29619658fc
Build and Push Docker Image / build (push) Failing after 1m35s
- Introduced a new graphify OpenCode plugin to remind users about the knowledge graph before executing bash commands. - Added AGENTS.md for agent guidance, including development commands, environment setup, Docker deployment, code structure, conventions, and testing instructions. - Created opencode.json to configure the graphify plugin and superpowers. - Updated tests to improve type safety and added missing imports in test files. - Added .graphify_uncached.txt to track relevant files for graphify.
Tests - Annas RechnungsManager
Vitest-basiertes Test-Framework für kritische Geschäftslogik.
Setup
# Install dependencies (already done)
npm install
# Run tests
npm run test # Single run
npm run test:watch # Watch mode
npm run test:ui # Browser UI
npm run test:coverage # With coverage report
Test Structure
tests/
├── lib/
│ ├── tax.test.ts # Steuerberechnungen (§14 UStG)
│ └── schemas.test.ts # Zod-Validierung (Input-Sicherheit)
└── README.md
Coverage
- ✅ tax.ts - German tax calculations (19%, 7%, Kleinunternehmer)
- ✅ schemas.ts - Input validation (Zod schemas)
- ⚠️ invoice-number.server.ts - Requires Prisma mocking (TODO)
Critical Test Areas
- Tax Calculations - Must be correct per German tax law
- Input Validation - Prevent invalid data in DB
- Invoice Logic - §14 UStG compliance
- Buchhaltung - Double-entry bookkeeping accuracy
Running Specific Tests
# Run only tax tests
npx vitest run tests/lib/tax.test.ts
# Run with coverage
npm run test:coverage
# Opens: ./coverage/index.html
Writing New Tests
import { describe, it, expect } from "vitest";
import { myFunction } from "@/lib/my-module";
describe("myModule", () => {
it("should do something", () => {
expect(myFunction()).toBe(expected);
});
});
CI Integration
Tests laufen automatisch in der Gitea Actions Pipeline (.gitea/workflows/build.yml).