segmentio/nightmare — pull request #77 by johntitus (2014-10-22 12:20:49+00:00)
Title: Fix for #11 - verify file existence before trying to .upload()

Verify's a file's existence before calling phantom's .uploadFile(). Returns an error if path is invalid. Uses fs.existsSync.

- Modified index.js .run() to detect if the last action has passed back an error, and if so, actually send it to the .run callback. Previously, err was always going to be null.

- Added tests for .upload happy case and unhappy case.