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

Aperta
#28 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
eslint, github-actions, typescript, vite

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
TypeScript
Stelle
3
Fork
3
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TMHSDigital/GH-Arcade

Tutte le issue di TMHSDigital/GH-Arcade

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.