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.

Cypress + Cucumber + Typescript + Webpack does not work

See original GitHub issue

Hello ! I cannot get my cypress tests to work in my Angular app, writing tests with Cucumber and Typescript. Here is a repo that reproduces the issue: https://github.com/loriepisicchio/cypress-typescript-cucumber-demo. To reproduce the issue, simply run npm run cypress This will open the Cypress dashboard. Then run Facebook.feature for instance. And you’ll get the following exception :

/home/pisicchl/dev/playground/cypress/cypress-typescript-cucumber-demo/cypress/integration/facebook/Facebook/facebook.ts
./cypress/integration/facebook/Facebook/facebook.ts
[tsl] ERROR in /home/pisicchl/dev/playground/cypress/cypress-typescript-cucumber-demo/cypress/integration/facebook/Facebook/facebook.ts(2,23)
      TS7016: Could not find a declaration file for module 'cypress-cucumber-preprocessor/steps'. '/home/pisicchl/dev/playground/cypress/cypress-typescript-cucumber-demo/node_modules/cypress-cucumber-preprocessor/steps.js' implicitly has an 'any' type.

/home/pisicchl/dev/playground/cypress/cypress-typescript-cucumber-demo/e2e/src/app.e2e-spec.ts
[tsl] ERROR in /home/pisicchl/dev/playground/cypress/cypress-typescript-cucumber-demo/e2e/src/app.e2e-spec.ts(12,37)
      TS2551: Property 'toEqual' does not exist on type 'Assertion'. Did you mean 'equal'?

/home/pisicchl/dev/playground/cypress/cypress-typescript-cucumber-demo/src/app/app.component.spec.ts
[tsl] ERROR in /home/pisicchl/dev/playground/cypress/cypress-typescript-cucumber-demo/src/app/app.component.spec.ts(20,17)
      TS2339: Property 'toBeTruthy' does not exist on type 'Assertion'.

/home/pisicchl/dev/playground/cypress/cypress-typescript-cucumber-demo/src/app/app.component.spec.ts
[tsl] ERROR in /home/pisicchl/dev/playground/cypress/cypress-typescript-cucumber-demo/src/app/app.component.spec.ts(26,23)
      TS2551: Property 'toEqual' does not exist on type 'Assertion'. Did you mean 'equal'?

/home/pisicchl/dev/playground/cypress/cypress-typescript-cucumber-demo/src/app/app.component.spec.ts
[tsl] ERROR in /home/pisicchl/dev/playground/cypress/cypress-typescript-cucumber-demo/src/app/app.component.spec.ts(33,54)
      TS2551: Property 'toContain' does not exist on type 'Assertion'. Did you mean 'contain'?

There seems to be some kind of conflict between jasmine version used in my Angular app tests, and the one used by Cypress. To create this project, I used this one as a reference : https://github.com/TheBrainFamily/cypress-cucumber-webpack-typescript-example

Let me know if I can provide any other info that helps investigating this. Thanks !

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:18

github_iconTop GitHub Comments

4reactions
lgandeckicommented, May 18, 2019

(btw, I might work on an example for Angular at some point, if I have a bit of free time, just as an experiment, if I get it to work I will message here)

4reactions
kellyprankincommented, Jan 22, 2019

Any hints on how to get this to work in an Angular project since webpack is handled automatically? Should it be the same?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cypress + Cucumber + Typescript + Webpack does not work
Hello ! I cannot get my cypress tests to work in my Angular app, writing tests with Cucumber and Typescript. Here is a...
Read more >
Cucumber support for Cypress with Webpack and TypeScript
After some research, we found Cypress as the perfect allie against any potential regressions and an effective tool to automate UI tests ...
Read more >
Webpack Compilation Error with Cypress 10 and Cucumber in ...
First, make sure that you use the latest version of @badeball/cypress-cucumber-preprocessor which fix some compatibilty issues with cypress ...
Read more >
@cypress/webpack-preprocessor - npm
Start using @cypress/webpack-preprocessor in your project by running ... TypeScript icon, indicating that this package has built-in type ...
Read more >
Preprocessors API - Cypress Documentation
The webpack preprocessor handles: ES2015 and JSX via Babel; TypeScript; CoffeeScript 1.x.x; Watching and caching files. Are you looking to change the ...
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