Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add unit test for useDemosWorkspaceLoader

Aperta Adatta ai principianti
#752 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

Inizia da lua-learning-website/src/hooks/useExamplesWorkspaceLoader.test.ts e confrontalo con src/hooks/useDemosWorkspaceLoader.ts. Aggiungi il file di test corrispondente in lua-learning-website/src/hooks/useDemosWorkspaceLoader.test.ts, coprendo la risoluzione, la pulizia dello stato pending, la protezione dai duplicati e l'annullamento allo smontaggio; esegui i test dell'hook per confermare la parità.

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

Descrizione

tech-debt

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 demos removed 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.

Lingua principale
TypeScript
Stelle
1
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

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 jcollard/LuaInTheWeb

Tutte le issue di jcollard/LuaInTheWeb

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.