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.

TypeScript configuration transpiling all `.ts` files in project?

See original GitHub issue

I’m attempting to add cypress@3.0.3 and cypress-cucumber-preprocessor@1.2.2 with tsify@4.0.0 to an existing Angular 6 project. However, I am getting a TypeScript transpilation error in some code located outside of the cypress directory when running any test, even the stock JavaScript examples provided with Cypress.

If I do not have any .feature files or corresponding TypeScript step definitions, I get an error of the form:

 Oops...we found an error preparing this test file:
...
This occurred while Cypress was compiling and bundling your test code. This is usually caused by:

A missing file or dependency
A syntax error in the file or one of its dependencies
Fix the error in your code and re-run your tests.

If I have added .feature file & corresponding step definition, the same TypeScript error gets referenced by way of a plugin error:

Error running plugin
The following error was thrown by a plugin. We've stopped running your tests because a plugin crashed.
...

I am using the cypress/plugins/index.js configuration provided in the README.md. The same occurs with or without a cypress/tsconfig.json. From testing, I suspect that the tsify babel plugin is either ignoring entirely or perhaps always using the root tsconfig.json rather than the one closest to the cypress code.

How can I configure cypress with cypress-cucumber-preprocessor to only transpile TypeScript code inside of the cypress directory?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
mhodgsoncommented, Aug 24, 2018

Cool. I opened a PR to simplify the README: #92

0reactions
cookiescrumbscommented, Oct 26, 2018

Does using '@cypress/browserify-preprocessor' fix this https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/issues/61?

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript configuration transpiling all .ts files in project? #84
I'm attempting to add cypress@3.0.3 and cypress-cucumber-preprocessor@1.2.2 with tsify@4.0.0 to an existing Angular 6 project.
Read more >
Compile TypeScript Project - TutorialsTeacher
As you know, TypeScript files can be compiled using the tsc <file name>.ts command. It will be tedious to compile multiple .ts files...
Read more >
TSConfig Reference - Docs on every TSConfig option
A TSConfig file in a directory indicates that the directory is the root of a TypeScript or JavaScript project... Compiler Options. Top Level....
Read more >
TypeScript Compiling with Visual Studio Code
Transpile TypeScript into JavaScript · Step 1: Create a simple TS file · Step 2: Run the TypeScript build · Step 3: Make...
Read more >
Configuring TypeScript compiler - inDepthDev
TS automatically compiles all files in a project directory and its sub-directories. It treats every directory with tsconfig.json file in the root as...
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