nathanboktae / mocha-phantomjs

:coffee: :ghost: Run client-side mocha tests in the command line through phantomjs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error loading resource after following Readme

cloakedninjas opened this issue · comments

Followed the guide here: http://metaskills.net/mocha-phantomjs/

Installed with -g option, copied the sample HTML file, replaced test script with my own. Upon running the command I get:

Error loading resource file:///path/to/project/test/mocha.css (203). Details: Error opening /path/to/project/test/mocha.css: No such file or directory
Error loading resource file:///path/to/project/test/mocha.js (203). Details: Error opening /path/to/project/test/mocha.js: No such file or directory
Error loading resource file:///path/to/project/test/chai.js (203). Details: Error opening /path/to/project/test/chai.js: No such file or directory
TypeError: 'undefined' is not a function (evaluating 'mocha.ui('bdd')')

Did I miss something? Am I responsible for providing mocha + chai libs?

Followed the guide here: http://metaskills.net/mocha-phantomjs/

That guide was made by the previous owner @metaskills for v3. Please follow the readme here on GitHub for the latest documentation. I don't have the ability to update that site as it's Ken's personal site. Ken do you want to update it or even better, just have it redirect over here?

Am I responsible for providing mocha + chai libs?

Yes. (You can use any assertion library you want, but chai is the best, IMO). The idea is you have your local testing setup however you want already, and you can add mocha-phantomjs to test from the command line without changing anything. (you also don't need mochaPhantomJS.run as of 4.0)

@nathanboktae Following on from resource loading, is requirejs supported? I seem to have a problem with mocha not being initialised when running from the cli, but working fine in a browser.

Do you have the latest mocha-phantomjs with mocha-phantomjs-core > 1.1.0? see nathanboktae/mocha-phantomjs-core#9 - I recently fixed requirejs loading there.