nodeunit
nodeunit copied to clipboard
Fix a bug about nodeunit cannot open absolute path
Fix a bug that is happen when nodeunit try to test a file by the absolute path.
path.join(process.cwd(), filename) is a code in some reporters does not work when the filename is absolute. Instead use path.resolve, and it works with an absolute file name.
confirmed;
$ cd -
/Users/howardyeend/Sites/
$ nodeunit /Users/howardyeend/Desktop/test.js
/usr/local/lib/node_modules/nodeunit/lib/nodeunit.js:72
if (err) throw err;
^
Error: ENOENT, stat '/Users/howardyeend/Sites/Users/howardyeend/Desktop/test.js'