- Add npm test scripts for build, markdown, HTML, and link validation - Install markdownlint-cli for content quality checks - Install html-validate for HTML5 conformity validation - Add htmltest (via devbox) for internal/external link checking - Configure test rules in .htmltest.yml, .htmlvalidate.json, .markdownlint.json - Add GitHub Actions workflow for automated CI testing - Add TESTING.md documentation for test usage
62 lines
1.1 KiB
Markdown
62 lines
1.1 KiB
Markdown
# Hugo Site Testing
|
|
|
|
Dieses Projekt verwendet mehrere automatisierte Tests zur Qualitätssicherung.
|
|
|
|
## Verfügbare Tests
|
|
|
|
### 1. Build-Test
|
|
```bash
|
|
npm run test:build
|
|
```
|
|
Prüft ob die Hugo-Seite überhaupt baut und zeigt Warnungen/Fehler an.
|
|
|
|
### 2. Markdown-Linting
|
|
```bash
|
|
npm run test:markdown
|
|
```
|
|
Validiert Markdown-Dateien auf Stilprobleme und Best Practices.
|
|
|
|
### 3. HTML-Validierung
|
|
```bash
|
|
npm run test:html
|
|
```
|
|
Prüft die generierte HTML auf HTML5-Konformität.
|
|
|
|
### 4. Link-Checker
|
|
```bash
|
|
npm run test:links
|
|
```
|
|
Testet alle internen und externen Links auf Gültigkeit.
|
|
|
|
### Alle Tests ausführen
|
|
```bash
|
|
npm test
|
|
```
|
|
|
|
### Schnelle Tests (ohne Link-Check)
|
|
```bash
|
|
npm run test:quick
|
|
```
|
|
|
|
## Konfigurationsdateien
|
|
|
|
- `.htmltest.yml` - Link-Checker-Konfiguration
|
|
- `.htmlvalidate.json` - HTML-Validierungs-Regeln
|
|
- `.markdownlint.json` - Markdown-Linting-Regeln
|
|
|
|
## CI/CD Integration
|
|
|
|
GitHub Actions führt diese Tests automatisch bei jedem Push/PR aus:
|
|
- `.github/workflows/test.yml`
|
|
|
|
## Lokale Entwicklung
|
|
|
|
Vor dem Commit empfohlen:
|
|
```bash
|
|
npm run test:quick # Schnelle Tests
|
|
```
|
|
|
|
Vor dem Push:
|
|
```bash
|
|
npm test # Alle Tests inkl. Link-Check
|
|
```
|