Skip to content

Provide an option to disable test files preprocessing. #533

Closed
@kamituel

Description

@kamituel
  • Operating System: Mac
  • Cypress Version: 0.19.2
  • Browser/Browser Version: Chrome 58

Are you requesting a feature or reporting a bug?

Feature.

Current behavior:

Cypress preprocesses test JavaScript files (using Babel / Browserify). I'd like to use ClojureScript to write tests, which means using a compiler (based on Google Closure) to obtain a final test JS file. However, Google Closure produces JS files that expect this to be set when invoked outside of a function (in the global context). Current Cypress' preprocessing makes this undefined, which breaks code compiled using Google Closure. I don't know of any obvious workaround for this.

Expected behavior:

To be able to disable test JS files preprocessing, so that I can use ClojureScript / Google Closure compiler.

How to reproduce the current behavior:

  1. Create a ClojureScript test namespace:
(ns st.general)

(js/describe "General" (fn []
  (js/it "Page title" (fn []
    (js/cy.visit "http://localhost:80")
    (.should (js/cy.title) "equal" "Page Title")))))
  1. Compile it using ClojureScript compiler to cypress/integration/test.js

  2. Run this test using Cypress. It will hang for a long time, and eventually produce an error that can be tracked down to this being unset.

Test code:

n/a

Additional Info (images, notes, stack traces, etc)

This has been briefly discussed on Gitter on June 9th around 1:30 PM UTC.

Metadata

Metadata

Assignees

Labels

type: enhancementRequested enhancement of existing feature

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions