Mocha-phantomjs Cannot find variable: require

I have the same problem as described here Can't get PhantomJS to work with simple example , but the solution to have the correct version of phantomjs in my path doesn't work I seem to be fixing my problem.

I followed the tutorial here before T: http://net.tutsplus.com/tutorials/javascript-ajax/testing-javascript-with-phantomjs/?search_index=1

and everything works fine until I try to add require ('webpage'). create ().

phantomjs version 1.8.1 mocha-phantomjs 2.0.0

What else can I lose?

+3


source to share


2 answers


I also had this problem and the problem was my mocha version - back to 1.9.0 fixed it.



0


source


Use require-stub to get it require

for testing.



0


source







All Articles