CoffeeScript 2 support
See original GitHub issue- Operating System: Ubuntu 17.04
- Cypress Version: 0.20.1
- Browser Version: Chrome 62, Chromium 60, Electron 53
Is this a Feature or Bug?
Feature
Current behavior:
Cypress does not support CoffeeScript 2 syntax (especially the await
keyword), that was released a few days ago.
To fix this in Cypress server I replaced CS1 with CS2 (see below how to reproduce).
Then everything was working fine with my CS2 tests, but only using the Cypress app (via cypress open
). Via cypress run
I got weird errors with electron, chrome and chromium browsers (see stack trace below ).
Desired behavior:
CoffeeScript 2 tests working “out of the box” after a fresh Cypress install, with cypress open
as well as cypress run
.
How to reproduce:
In Cypress server I replaced CS1 with CS2 like so:
cd node_modules/cypress/dist/Cypress/resources/app/packages/server/
npm i coffeescript@next
cd node_modules
mv coffee-script/ coffee-script_V1
ln -s coffeescript/ coffee-script
Additional Info (images, stack traces, etc)
Using cypress run
with CoffeeScript 2, I get the following error:
npx cypress run --browser electron --config baseUrl=http://localhost:5000
Started video recording: /home/laurent/myproject/cypress/videos/k38ej.mp4
(Tests Starting)
1) An uncaught error was detected outside of a test
0 passing (236ms)
1 failing
1) An uncaught error was detected outside of a test:
Uncaught SyntaxError: missing ) after argument list
Cypress could not associate this error to any specific test.
We dynamically generated a new test to display this failure.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Announcing CoffeeScript 2
CoffeeScript 2 adds support for async functions syntax, for the future object destructuring syntax, and for JSX. Some features, such as modules (...
Read more >CoffeeScript 2 documentation - DevDocs
CoffeeScript 2.7.0 API documentation with instant search, offline support, keyboard shortcuts, mobile version, and more.
Read more >Support coffeescript 2 · Issue #144 · kimroen/ember-cli ...
Hi there, Coffeescript 2 is getting real: http://coffeescript.org/v2/ (coffeescript6/discuss#80). It supports many ES2015 features.
Read more >CoffeeScript 2 Released With Support For Async - I Programmer
The second major change in CoffeeScript 2 is support for async functions syntax, for the future object destructuring syntax, and for JSX.
Read more >CoffeeScript 2.0 Released - Support My Idea
Modules: import / export; Classes: class Animal; Async functions: await someFunction(); Bound/arrow functions: =>; Function default parameters: ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can now do this yourself by modifying the
browserify
options and add your own coffeescript 2 support.Fixed by https://github.com/cypress-io/cypress/pull/888.
Transpiling to CS2 will soon be supported by the plugins / extensions API.