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

Aperta Adatta ai principianti
#4,796 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
testing

Direzione di ricerca

Leggi foreign/node/src/wire/user/create-user.command.test.ts e i due serializer nel Node SDK. Aggiungi i file di test denominati per change-password e delete-user, costruendo i buffer attesi in modo indipendente. Esegui npm run test:unit e npm run lint da foreign/node; il lavoro è completato quando i casi di byte richiesti passano.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
Rust
Stelle
5.2k
Fork
516
Merge medio
2g 12h
PR unite (30g)
145

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/iggy

Tutte le issue di apache/iggy

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.