Test the device table's notes and its sort order

Đang mở Phù hợp với người mới
#34 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 1 ngày

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
90/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ệ
javascript, node.js
Lĩnh vực
testing

Hướng nghiên cứu

Đọc scripts/devices/table.test.mjs và scripts/devices/fixtures/good-report.json, sau đó kiểm tra cách helper hiện có faster() tạo báo cáo và cách gọi renderTable(). Thêm các bài kiểm tra cho ghi chú và thứ tự sắp xếp được chỉ định, giữ nguyên table.mjs và fixture. Chạy node --test scripts/devices/table.test.mjs và pnpm test; hoàn tất khi các bài kiểm tra mới chạy thành công và đã chứng minh được rằng mỗi bài kiểm tra đều thất bại khi một kỳ vọng bị phá vỡ.

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

Mô tả

agent-friendly good first issue

Why

scripts/devices/table.mjs builds the device table in docs/devices.md from Device lab reports, and some of its notes and its tie-breaks have no test yet. Those rows matter as reports arrive (ROADMAP.md, Now: the Device lab).

What to do

Today scripts/devices/table.test.mjs covers "battery saver on" and "paused once for heat". Add tests there, building made-up reports from scripts/devices/fixtures/good-report.json the way its faster() helper does, and passing them to renderTable():

  1. Notes: device.lowRam: true shows "low-RAM device"; run.thermalPauses: 3 shows "paused 3 times for heat"; a report with battery saver on, low RAM and two pauses shows all three, in that order, joined by ", ".
  2. Sort order: with equal speed.tokensPerSecond, rows go by phone name (maker and model) from A to Z; with the same phone and speed, the newer run.date comes first.
  3. Check that each new test can fail: break one expectation on purpose, see it fail, put it back.

Done when

  • The new tests pass, and scripts/devices/table.mjs is unchanged.
  • scripts/devices/fixtures/good-report.json is unchanged: other tests depend on it.

How to check

node --test scripts/devices/table.test.mjs
pnpm test

Keep in mind

  • Tests only. If a test shows a real bug, open a bug report and leave table.mjs alone in this pull request.
  • Made-up phones only, like the Examplecorp EX-1000 in the fixture.
Ngôn ngữ chính
TypeScript
Star
11
Fork
0
Merge trung bình
10 phút
Pull request đã merge (30 ngày)
6

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 DojoCodingLabs/hermit

Tất cả issue của DojoCodingLabs/hermit

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.