Try giving phantomjs access to test via window.