question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide an option to disable test files preprocessing.

See original GitHub issue
  • 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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
brian-manncommented, Nov 20, 2017
2reactions
chrisbreidingcommented, Aug 25, 2017

We’re currently working on a generic plugin system for preprocessing spec files that will solve this issue. You’ll be able to create a plugin that integrates with the Cypress preprocessing pipeline. It will allow you to disable the default preprocessing, or you could create a ClojureScript preprocessor that transpiles your ClojureScript tests and lets the app know to re-run.

This should be released within the next month or so. If it doesn’t make it into 1.0.0, it will be in 1.1.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Writing and Organizing Tests - Cypress Documentation
Set the watchForFileChanges configuration property to false to disable file watching. Nothing is watched during cypress run. The watchForFileChanges property is ...
Read more >
Preprocessor Options (Using the GNU Compiler Collection ...
These options control the C preprocessor, which is run on each C source file before actual compilation. If you use the -E option,...
Read more >
Preprocessing Options - Lahey Fortran
Use this option to manually enable preprocessing of any kind of Fortran file. To disable preprocessing of files with any of the above...
Read more >
Running Tests (Atest) | Android Open Source Project
Atest can force a test to skip the cleanup or teardown step. Many tests, such as CTS, clean up the device after the...
Read more >
html-loader - webpack
Options. sources; preprocessor; minimize; esModule ... argument contains a path to the loaded HTML file. if (/example\.pdf$/.test(value)) { return false; } ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found