nathanboktae / mocha-casperjs

Write CasperJS tests using Mocha
MIT License
120 stars 29 forks source link

No ES6 support (need note in README) #106

Closed thom-nic closed 7 years ago

thom-nic commented 7 years ago

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:

describe('login page', () => { .... }

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.

nathanboktae commented 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.