Node SDK: add unit tests for the change password and delete user commands

Đang mở Phù hợp với người mới
#4,796 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
82/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ệ
typescript
Lĩnh vực
testing

Hướng nghiên cứu

Đọc foreign/node/src/wire/user/create-user.command.test.ts và hai bộ tuần tự hóa trong Node SDK. Thêm các tệp kiểm thử được đặt tên cho change-password và delete-user, đồng thời tự xây dựng các buffer mong đợi. Chạy npm run test:unit và npm run lint từ foreign/node; hoàn tất khi các trường hợp byte được yêu cầu chạy thành công.

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

Mô tả

good first issue javascript test
Description

CHANGE_PASSWORD.serialize and DELETE_USER.serialize in the Node SDK have no unit tests. client.socket.test.ts calls them through a mock server but does not check the bytes. CHANGE_PASSWORD writes the user identifier, then each password as a one byte length and the bytes, and throws when either password is under 1 or over 255 bytes (counted in bytes, not characters). DELETE_USER writes only the identifier.

Affected area / component

Node SDK

Proposed solution

Add foreign/node/src/wire/user/change-password.command.test.ts and delete-user.command.test.ts, following create-user.command.test.ts, including its UTF-8 case for the 255 byte limit.

  • Change password: the exact bytes for a numeric user id, an empty current password, an empty new password, a 255 byte password accepted, a 256 byte password refused, and a multi-byte password that is under 255 characters but over 255 bytes.
  • Delete user: the exact bytes for a numeric and a string identifier.
  • Build the expected buffers by hand, so the test does not call the code it checks.

How to test: npm run test:unit and npm run lint pass in foreign/node.

Good first issue
  • I think this could be a good first issue for a new contributor
Ngôn ngữ chính
Rust
Star
5.2k
Fork
516
Merge trung bình
2 ngày 12 giờ
Pull request đã merge (30 ngày)
145

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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 apache/iggy

Tất cả issue của apache/iggy

Issue tương tự

Thêm issue về Rust

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.