Add a test runner, a lint step and a pull_request CI check

Offen
#28 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
65/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
eslint, github-actions, typescript, vite

Rechercherichtung

Read package.json and .github/workflows/deploy.yml to understand the existing scripts and deployment workflow; check tsconfig.json for the current type-check scope. Add the requested test, lint and pull request checks, keeping deployment gated to main, then run npm test, npm run lint and npm run build. Done when all checks pass and pull requests receive a required check.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

severity: medium testing

Summary

There is no test framework, no linter and no check before code reaches main. The only workflow deploys on push if tsc and vite build pass.

Where

  • package.json:8-14 (scripts: dev, build, preview, typecheck, new-game)
  • .github/workflows/deploy.yml:3-6, .github/workflows/deploy.yml:26-27
  • tsconfig.json:17 (scripts/new-game.mjs is not type-checked)

Impact

A logic regression in rules code, trophy unlocks or save handling ships with no automated signal, and pull requests get no feedback.

Suggested fix

  • Add vitest with "test": "vitest run" and a separate vitest.config.ts using environment: 'node', so the PWA plugin and multi-page inputs are not loaded
  • Add ESLint with typescript-eslint and a lint script
  • Add a pull_request trigger that runs install, lint, test and build only (deploy stays gated to main)
  • Run npm test before npm run build in the deploy workflow

Acceptance criteria

  • npm test and npm run lint exist and pass
  • Pull requests show a required check

Getting started

  • Relevant files: package.json, .github/workflows/deploy.yml, tsconfig.json
  • Run locally: npm install, then npm run dev
  • Checks: npm run typecheck and npm run build (there is no test suite yet)
  • Related docs: README.md

Filed by repo-audit/full-audit at b001f5d. Severity: medium. Effort: M. audit-key: testing|package.json|scripts.test

Vorherrschende Sprache
TypeScript
Sterne
3
Forks
3
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus TMHSDigital/GH-Arcade

Alle Issues in TMHSDigital/GH-Arcade

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.