function isFileReady(readyState) {
        // Check to see if any of the ways a file can be ready are available as properties on the file's element
        return (!readyState || readyState == 'loaded' || readyState == 'complete' || readyState == 'uninitialized');
    }
Sourced from: https://github.com/nathanboktae/mocha-phantomjs-core