-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular - Cypress component test failure #12114
Comments
We're having the same issue, trying to component test an angular UI library, which has no main. |
odds are your can you post the build target the login project you used? |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
We're having the same issue, trying to component test an angular UI library. We tried to define an extra build target for the library project like this: {
"projectType": "library",
// [...]
"targets": {
// [...]
"build-component-test": {
"executor": "@nrwl/angular:webpack-browser",
"options": {
"outputPath": "dist/libs/cb-template-feature/ui",
"index": "libs/cb-template-feature/ui/cypress/index.html", // <- extra file created manually just for component testing
"main": "libs/cb-template-feature/ui/cypress/main.ts", // <- extra file created manually just for component testing
"tsConfig": "libs/cb-template-feature/ui/tsconfig.e2e.json",
"customWebpackConfig": {
"path": "libs/cb-template-feature/ui/cypress/webpack.config.js"
}
}
},
"component-test": {
"executor": "@nrwl/cypress:cypress",
"options": {
"cypressConfig": "libs/cb-template-feature/ui/cypress.config.ts",
"testingType": "component",
"skipServe": true,
"devServerTarget": "cb-template-feature-ui:build-component-test"
}
}
}
} But we got the following error:
|
@quirin-buechner-mdctec it looks like I didn't null check the polyfills property before trying to use it in the CT preset. should be fixed here: #16411 You can get around it by adding the it as an executor option for build-component-test target you have. should be able to set it to an empty string if you don't have any polyfills you wish to apply as well. |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
Trying to run a component-test with following command
npx nx component-test login
, but it fails withError: Missing executor options "main"
Expected Behavior
To run Cypress Component Testing
Steps to Reproduce
Used following guide: https://nx.dev/cypress/cypress-component-testing
The generator created this file
login.component.cy.ts
My Cypress config file:
test-ui/libs/login/cypress.config.ts
Failure Logs
Environment
The text was updated successfully, but these errors were encountered: