Comments (5)
Webpack extension is also going to be useful for code coverage. The original way looks like this:
https://github.com/bahmutov/cypress-angular-unit-test#code-coverage
from devkit.
Actually, there's no way to extend the webpack configuration as it's generated from Angular CLI internals, but that's a feature we can think about.
from devkit.
Sadly I ran into various issues while trying to combine these together:
- Angular 12 project generated with
@nrwl/nx
(i.e. heavily TypeScript based) - Cypress component testing (
@jscutlery/cypress-angular
)- With Cucumber feature support (
cypress-cucumber-preprocessor
) - With code coverage instrumentation (
@cypress/code-coverage
,ngx-build-plus
)
(Even if we ignore coverage for now,ngx-build-plus
is still the idea to load.feature
files.)
- With Cucumber feature support (
The issues I experienced:
import '@cypress/code-coverage/support';
fails withReferenceError: Cypress is not defined
- feature files don't compile for the following error:
Error: Dev-server compilation failed. We can not run tests if dev-server can not compile and emit assets, please make sure that all syntax errors resolved before running cypress.
[object Object]
at EventEmitter.<anonymous> (/home/rkrisztian/.cache/Cypress/7.4.0/Cypress/resources/app/packages/server/lib/modes/run-ct.js:8:7)
at EventEmitter.emit (events.js:327:22)
at EventEmitter.<anonymous> (/home/rkrisztian/.cache/Cypress/7.4.0/Cypress/resources/app/packages/server/lib/plugins/dev-server.js:15:17)
at EventEmitter.emit (events.js:315:20)
at ChildProcess.<anonymous> (/home/rkrisztian/.cache/Cypress/7.4.0/Cypress/resources/app/packages/server/lib/plugins/util.js:19:22)
at ChildProcess.emit (events.js:315:20)
at emit (internal/child_process.js:903:12)
at processTicksAndRejections (internal/process/task_queues.js:81:21)
After some debugging, the error is the following:
{
"moduleIdentifier": "/home/rkrisztian/my-project/apps/my-app/src/example.feature",
"moduleName": "./src/example.feature",
"loc": "1:13",
"message": "Module parse failed: Unexpected token (1:13)\nYou may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders\n> Feature: App Main Page..." // (Rest omitted!)
// ...
}
But I did include the rules into the webpack extension... :( And I also double checked that my webpack.extra.js
is loaded and syntactically valid...
from devkit.
badeball/cypress-cucumber-preprocessor#443 might be related to my problems.
from devkit.
Hi, now we can pass to the dev server a custom Webpack config that will be merged with the Angular CLI. This feature will be published soon.
from devkit.
Related Issues (20)
- Unable to execute integration spec files error thrown when calling cy.visit HOT 2
- setup-ct failing with Angular 13 and Nx v13 HOT 9
- (0 , configs_1.getBrowserConfig) is not a function HOT 1
- Referencing assets like fonts or images inside an scss using url(`...`)
- Access to TestBed for DI of a Service to be able to mock return values
- angular.json not updated when generating a new test setup
- Angular 13 and Nx 13 issue HOT 4
- Can cypress-angular be integrated with cypress-cucumber-preprocessor
- which version of angular supported by @jscutlery/cypress-angular? HOT 2
- Method of harness not always working HOT 1
- Cannot find module '@storybook/angular' or its corresponding type declarations HOT 1
- Angular CLI setup breaks with 'Cannot find module 'nx/src/config/workspaces'
- cypress-harness-integration tests are broken HOT 3
- Add Cypress 10 support
- Release Microwave 0.1.4 on npm?
- it.skip is not a function
- cypress-harness ist not compatible to cypress 12 HOT 2
- Simplify `suspensify()` operator by removing the projector function
- suspensify() should provide a strict mode allowing type narrowing
- Hot can I add playwright-ct-angular to new nx angular project? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from devkit.