caolan / caolan/nodeunit

Low-Pri: Stop prepending process.cwd() to file paths in reporter run() functions

Offen
#109 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
1.9k
Forks
359
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

nodeunit is AWESOME. That said: the run() functions for the included reporters prepend process.cwd() to each test module file path; this causes problems in some environments (see below). The current work-around is to use process.chdir(), but it seems like modifying run() to just accept absolute paths would be less confusing.

I work in an environment where we can't always use the nodeunit binary to run our tests (some testing is done on Windows). This means we have our own test runner that manually calls reporter.run(['file1', file2', ...]) with file paths. The tests run on multiple machines, and the node executable isn't always located in the same location. Also, on some Windows machines you have node living in C:\ and tests living in X:\

Currently, our runner has to use process.chdir() to ensure that the paths work on every machine. It seems like it would be a little less confusing, however, if run() didn't try to modify the path and just used whatever it was given. In our case, we'd just "calculate" an absolute path--including the Windows drive, if necessary.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne bei den run()-Einstiegspunkten der enthaltenen Reporter und verfolge, wie der Pfad jedes Testmoduls verarbeitet wird. Reproduziere das Problem, indem du reporter.run() mit absoluten Pfaden aufrufst, einschließlich Pfaden auf verschiedenen Windows-Laufwerken. Erledigt ist es, wenn die Reporter die übergebenen Pfade verwenden, ohne process.chdir() zu benötigen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript
Bereich
testing
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.