Closed thom-nic closed 7 years ago
I came here thinking the tests are run in my local nodejs environment
That's a common misconception, but no. The tests run in phantomjs or slimerjs, depending on your casperjs setup. So if you use slimerjs, you do have ES6 available, and the features are according to the version of firefox running. So you have to be cognizant of what JS engine you choose.
I suspect this is obvious once you know the internals of how casper works, but I came here thinking the tests are run in my local nodejs environment, and since I'm using node 6.9 I should be able to use ES6 features like:
It seems that's not the case and I'm guessing it's highly dependent on the JS engine in Phantom?
Fair enough, but it might be worth a note in the README. When I do the above, the test is silently skipped rather than any error reported. Guessing that's related to #100?
To the casual observer it would be easy to assume the tests are run in the nodejs environment: Its just now becoming apparent that this (and casper in general, I guess) probably have more in common with jasmine (where tests are run in the browser) versus, say, capybara which remotely controls the phantomjs browser.