caolan / caolan/nodeunit

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

オープン
#109 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
1.9k
フォーク
359
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

含まれている reporter の run() エントリーポイントから始め、各テストモジュールのパスがどのように処理されるかを追跡します。異なる Windows ドライブ上のパスを含む絶対パスを使って reporter.run() を呼び出し、問題を再現します。reporter が process.chdir() を必要とせずに指定されたパスを使用できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
testing
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。