Add unit test for useDemosWorkspaceLoader
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 88/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- typescript
- Lĩnh vực
- testing
Hướng nghiên cứu
Bắt đầu với lua-learning-website/src/hooks/useExamplesWorkspaceLoader.test.ts và so sánh nó với src/hooks/useDemosWorkspaceLoader.ts. Thêm tệp kiểm thử tương ứng tại lua-learning-website/src/hooks/useDemosWorkspaceLoader.test.ts, bao quát việc resolve, dọn dẹp trạng thái pending, ngăn trùng lặp và hủy khi unmount; chạy các kiểm thử hook để xác nhận tính tương đương.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Background
PR #751 added src/hooks/useDemosWorkspaceLoader.ts as a near-verbatim parallel of useExamplesWorkspaceLoader.ts, but did not ship the corresponding test file. The reviewer flagged this as tech debt:
The parallel `useExamplesWorkspaceLoader.ts` has an accompanying `useExamplesWorkspaceLoader.test.ts`, but no equivalent `useDemosWorkspaceLoader.test.ts` was added. The code is a near-verbatim copy of the existing pattern so risk is low, but the test-value-parity with the template it was copied from isn't upheld.
Scope
Create lua-learning-website/src/hooks/useDemosWorkspaceLoader.test.ts mirroring useExamplesWorkspaceLoader.test.ts. Coverage should include:
- Loader resolves and appends the demos workspace to state
- Pending set has
demosremoved after resolution - Duplicate add is guarded (workspace already present)
- Cancellation on unmount
Files
- New:
lua-learning-website/src/hooks/useDemosWorkspaceLoader.test.ts - Template:
lua-learning-website/src/hooks/useExamplesWorkspaceLoader.test.ts
Also consider adding tests for demosFetcher.ts and createDemosWorkspace / fetchAndCreateDemosWorkspace in workspaceManagerHelpers.ts if the Examples counterparts have dedicated coverage.
Risk
Low — the code is a near-verbatim copy of a tested template. This is a test-parity tech-debt item, not a behavior fix.
- Ngôn ngữ chính
- TypeScript
- Star
- 1
- Fork
- 0
- 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
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của jcollard/LuaInTheWeb
-
tech-debt
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
jcollard/LuaInTheWeb#690 ·
-
tech-debt
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
jcollard/LuaInTheWeb#590 ·
-
tech-debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
jcollard/LuaInTheWeb#518 ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
jcollard/LuaInTheWeb#235 ·
-
tech-debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
jcollard/LuaInTheWeb#51 ·
Tất cả issue của jcollard/LuaInTheWeb
Issue tương tự
-
module-request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ports get and web print 'Port N already in use, trying next...' for every busy port they skipĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
appandflow/stim#1604 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
lingdojo/kana-dojo#31060 · 1 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
SSH workspace restore rewrites relative symlinks into the deleted sync-back staging directoryĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
paperclipai/paperclip#14173 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày