Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ web/screenshots/
web/cypress/videos/
web/dist/
web/node_modules/
web/coverage/
plugin-backend
# Leave these permanently for backwards compatability for backporting
node_modules/
Expand Down
18 changes: 10 additions & 8 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ make test-frontend

The Monitoring Plugin uses a dual testing approach for unit tests:

- **Frontend Unit Tests**: Jest + TypeScript for React components and utilities
- **Frontend Unit Tests**: Vitest + TypeScript for React components and utilities
- **Backend Unit Tests**: Go's built-in testing framework for server functionality

Unit tests focus on isolated function testing and run quickly in CI/CD pipelines, while E2E tests (Cypress) validate full user workflows.
Expand All @@ -191,8 +191,8 @@ Unit tests focus on isolated function testing and run quickly in CI/CD pipelines

- **Location**: Co-located with source files in `web/src/`
- **Naming**: `*.spec.ts` (e.g., `format.spec.ts`, `utils.spec.ts`)
- **Framework**: Jest 30.2.0 with ts-jest
- **Configuration**: `web/jest.config.js`
- **Framework**: Vitest 4.1.11
- **Configuration**: `web/vitest.config.mts`

**Backend Tests:**

Expand All @@ -211,6 +211,9 @@ make test-frontend
# Run individually from web directory
cd web && npm run test:unit

# Run with coverage
cd web && npm run test:unit:coverage

# Run Go tests directly
go test ./pkg/... -v
```
Expand All @@ -228,9 +231,8 @@ Create unit tests when:

**Frontend:**

- `jest` (v30.2.0) - Test runner and assertions
- `ts-jest` (v29.4.4) - TypeScript support
- `@types/jest` - TypeScript definitions
- `vitest` (v4.1.11) - Test runner and assertions
- `@vitest/coverage-v8` (v4.1.11) - Code coverage (v8 provider)

**Backend:**

Expand All @@ -240,8 +242,8 @@ Create unit tests when:
#### Frontend Unit Testing Structure

**Testing Framework & Configuration**
Test Framework: Jest + ts-jest
Configuration File: web/jest.config.js
Test Framework: Vitest
Configuration File: web/vitest.config.mts

**Test File Location & Naming Convention**
Pattern: \*.spec.ts files co-located with source code
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ This project uses [Prow](https://docs.prow.k8s.io/) for CI/CD automation. Pull r
make lint-backend # Go fmt and mod tidy
make test-translations # Verify i18n keys
make test-backend # Go unit tests
make test-frontend # Jest unit tests
make test-frontend # Vitest unit tests
```

3. **Required checks must pass** in CI before merging.
Expand Down
23 changes: 0 additions & 23 deletions web/jest.config.js

This file was deleted.

7 changes: 0 additions & 7 deletions web/jest.setup.ts

This file was deleted.

Loading