Cypress + Cucumber + Typescript + Webpack does not work
See original GitHub issueHello !
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:
- Created 5 years ago
- Comments:18
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
(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)
Any hints on how to get this to work in an Angular project since webpack is handled automatically? Should it be the same?