Skip to content

🧹 Dev infrastructure: tests, lint, CI #30

@fusion94

Description

@fusion94

Summary

The repo has no tests, no linting, and no CI. As features pile up the regression risk grows. This issue sets up the minimum viable dev infra so PRs can be gated on automated checks.

Scope

Tests

  • Frontend: Vitest + React Testing Library. Cover AuthContext, ProtectedRoute, login/register form happy + error paths, and the calendar multi-day/recurrence rendering logic in src/pages/CalendarPage.jsx:161-221 (the most fragile code in the app).
  • Backend: Vitest + Supertest against a temp SQLite DB. Cover every route in server/index.js for: auth required vs not, validation failures, happy paths.

Linting and formatting

  • ESLint flat config with eslint-config-react-app (or equivalent).
  • Prettier with the same config across frontend and backend.
  • lint-staged + Husky pre-commit hook running eslint --fix and prettier --write on staged files.

CI

  • GitHub Actions workflow on PR + push to main: install, lint, build, run frontend tests, run backend tests.
  • Branch-protect main to require the workflow to pass.

Acceptance Criteria

  • npm test runs frontend tests; passes locally.
  • cd server && npm test runs backend tests; passes locally.
  • npm run lint produces zero errors on the current codebase.
  • PRs run the workflow and show pass/fail status.
  • Pre-commit hook blocks commits with lint errors.
  • At least 30 tests across the two suites.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions