discussion: adding unit/integration tests for client . files

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

Maintainer thường phản hồi trong vòng 4 ngày

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Ít trao đổi
Công nghệ
javascript, typescript
Lĩnh vực
testing

Hướng nghiên cứu

Bắt đầu bằng việc xem xét phạm vi bao phủ được đề xuất cho i18n.js, persistState.ts, reducers.ts, store.ts và theme.js, cùng với các tệp được đề xuất bỏ qua. Xác định những tệp và hành vi nào cần được bao phủ, bao gồm việc reducers.ts có cần smoke test hay không và testing.md có nên được cập nhật hay không; công việc được xem là hoàn tất khi phạm vi đã được thống nhất và các test được chọn đã được thêm vào.

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

Mô tả

Enhancement Needs Discussion

Proposed Tests

File Type What to Cover
i18n.js Unit languageKeyToLabel, languageKeyToDateLocale, currentDateLocale, language selection precedence (window.INITIAL_STATE vs detected fallback)
persistState.ts Unit Save/load/clear happy paths, invalid JSON, missing storage values, storage errors with console.warn
reducers.ts Smoke? Needs discussion — unsure if a smoke test is worth adding to verify combined state shape keys and init state, without re testing each child reducer deeply.
store.ts Unit showReduxDevTools() conditions, setupStore() behavior (persisted state precedence, clearState called, dev-tools enhancer toggling)
theme.js Unit remSize, prop success/error states, extend immutability/deep merge, key overrides in contrast theme

Files I'm skipping (browserHistory.js, constants.js, middleware.js) — don't seem to need tests, but open to feedback.


Discussion Questions

1. Which files actually need tests? Are the files in the table above the right ones to focus on, or are some not worth testing? Should reducers.ts get a smoke test?

2. Is this a priority right now? If not, which folders/files in the codebase would benefit most from test coverage first?

3. Should we update testing.md? Currently it's hard to know which files need tests. Would it make sense to add a checklist of all files that need coverage to testing.md in the contributor docs, and check them off as coverage improves? This would make it easier for contributors to pick up testing tasks without guessing.

Ngôn ngữ chính
JavaScript
Star
1.7k
Fork
1.7k
Merge trung bình
7 ngày 1 giờ
Pull request đã merge (30 ngày)
13

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

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 processing/p5.js-web-editor

Tất cả issue của processing/p5.js-web-editor

Issue tương tự

Thêm issue về JavaScript

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.