Low-Pri: Stop prepending process.cwd() to file paths in reporter run() functions
- Dominant language
- JavaScript
- Stars
- 1.9k
- Forks
- 359
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.