drakeRAGE/CaptureChronicles

Add Testing Setup for Frontend and Backend

Offen

#24 geöffnet am 28.10.2025

 (2 Kommentare) (0 Reaktionen) (2 zugewiesene Personen)JavaScript (7 Forks)auto 404
backendenhancementfrontendgood first issuehacktoberfesthelp wantedtesting

Repository-Metriken

Stars
 (5 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

Description:

Currently, there are no tests in the project. We need to add a proper testing setup for both the frontend (/gallery) and backend (/api) apps to ensure code reliability, prevent regressions, and make future development safer. After setup, running npm run test in either folder should execute the respective test suites successfully.


Plan

Frontend (/gallery)

  • Use Vitest + React Testing Library for component and UI testing.
  • Configure a setupTests.js file.
  • Add a sample test for one component (e.g., Hero).
  • Add a test script (npm run test) to package.json.

Backend (/api)

  • Use Jest + Supertest for API and controller testing.
  • Add a simple test for one route (e.g., /api/users).
  • Add a test script (npm run test) to package.json.

Optional (Full Stack)

  • Integrate Playwright for end-to-end (E2E) tests that check frontend + backend flows.

Acceptance Criteria

  • Frontend test setup using Vitest + RTL is configured.
  • Backend test setup using Jest + Supertest is configured.
  • Running npm run test in each app executes tests successfully.
  • Sample tests pass in both apps.
  • Test scripts are added to package.json and also on root package.json.
  • (Optional) Playwright setup is ready for future E2E testing.

Contributor Guide