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
cypress 10.0 renamed ignoreTestFiles to excludeSpecPattern but @nrwl/cypress wasn't updated #13860
Comments
Relevant change on cypress: https://docs.cypress.io/guides/references/changelog#10-0-0 |
here's a workaround that I figured out: create a separate cypress.config.ts for each configuration you want to be different: cypress.production.config.ts import { defineConfig } from 'cypress';
import baseConfig from './cypress.config';
export default defineConfig({
...baseConfig,
e2e: {
...baseConfig.e2e,
excludeSpecPattern: '**/preprod/**/*',
},
}); Then in the project.json "configurations": {
"production": {
"baseUrl": "https://foo.bar",
"cypressConfig": "apps/foo-e2e/cypress.production.config.ts",
}, This is especially useful since @nrwl/cypress is also not passing through the "specPattern" when passed in the configuration. |
If @nrwl/cypress is not going to support all the cypress configuration in the project file maybe it's best to not have partial support, that way devs aren't wasting their time trying to figure out why the configuration is being ignored? And if properties aren't being passed through, maybe the config should throw? |
I updated the changes in #13942 but the option is still being ignored by cypress. I'll reach out the Cypress team to see what might be happening there. |
So in v10 the excludeSpecPattern is now a specific e2e/component level option vs a root level option. i.e. export default defineConfig({
excludeSpecPattern: "" // this doesn't do anything and where cypress executor is adding the option
e2e: {
excludeSpecPattern: "" // this is where this is defined
},
component: {
excludeSpecPattern: "" // also can be here
}
}) |
@barbados-clemens Hey, thanks for taking this on <3 So I guess you have to pass-through in both places or remove the override? It may be worth auditing all the properties passed through as I suspect this isn't the only broken one. |
until PR #13942 is merged in, you'll have to defined them in the cypress config. Without most people out for the holidays it could be a little bit before that PR is able to be reviewed and merged. |
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
specifying ignoreTestFiles or excludeSpecPattern in configurations does nothing on cypress >= 10.0
Expected Behavior
either ignoreTestFiles should work or excludeSpecPattern should work.
from project.json
Github Repo
https://github.com/jethrolarson/nx-examples/tree/master/apps/cart-e2e
Steps to Reproduce
nx e2e my-app-e2e --configuration=myconfig
expected:
matching test is not run
actual:
test is run
Nx Report
Failure Logs
Additional Information
Looks like
nx/packages/cypress/src/executors/cypress/cypress.impl.ts
just needs to be updated to use the new name for that property.The text was updated successfully, but these errors were encountered: