caolan / caolan/nodeunit

setUp and tearDown do not appear to work in the browser

Aperta
#212 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
1.9k
Fork
359
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Steps to reproduce:
1. Go into the examples/browser folder
2. Open test.html
3. Everything works as expected
4. Add setUp and tearDown functions to suite1.js
5. Refresh the page to rerun the tests

_Defect_: the functions added in step 4 are run just like normal tests

This appears to be a defect in the copy of `nodeunit.js` in the examples/browser folder. The example's version of nodeunit.js has a function `wrapGroup` but this is never called; whereas the node-based `nodeunit.js` in lib/core.js does call this.

(Sorry that I don't understand the code base well enough at the moment to offer a patch.)

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia con examples/browser/test.html, examples/browser/suite1.js e la copia per il browser di nodeunit.js, quindi confronta la gestione di wrapGroup con lib/core.js. Aggiorna test.html dopo aver aggiunto setUp e tearDown per confermare che gli hook vengano trattati come setup e teardown anziché come test normali; l'esempio del browser dovrebbe essere eseguito senza segnalarli come test.

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

Valutazione

Stack tecnologico
javascript, node.js
Ambito
frontend, testing
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.