-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CoffeeScript 2 support #663
Comments
Can you provide an example of your test code? |
Sure. describe("dummy tests:", ->
context("foo:", ->
it.only "should return 4", ->
# result = 2 + 2 # no error
result = await Promise.resolve(2 + 2) # generates an error with `cypress run`
expect result
.to.equal 4
)
) |
Just curious - are you writing unit tests in Cypress? Why would you use the |
Yes I write "not so unit" tests in Cypress. I use Firebase and I need to test some promise-returning CRUD functions I wrote that are using Firebase calls. That way I can test database security rules located on the Firebase cloud side.
Also to use Firebase node admin functionalities (test users creation on the fly, JWT generation etc.) I had to set an express server up that I'm calling inside Cypress tests via POST fetch requests . Let me know if you see a better alternative… |
Transpiling to CS2 will soon be supported by the plugins / extensions API. |
#684 is really epic. Cypress is getting better and better 👍 |
You can now do this yourself by modifying the Fixed by #888. |
Fixed in |
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
). Viacypress 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 ascypress run
.How to reproduce:
In Cypress server I replaced CS1 with CS2 like so:
Additional Info (images, stack traces, etc)
Using
cypress run
with CoffeeScript 2, I get the following error:The text was updated successfully, but these errors were encountered: