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

Đang mở
#28 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
65/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
eslint, github-actions, typescript, vite
Lĩnh vực
build-system, ci-cd, testing

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
3
Fork
3
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TMHSDigital/GH-Arcade

Tất cả issue của TMHSDigital/GH-Arcade

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.