Specifying specPattern via CLI args doesn't work in component-testing mode #29317
Labels
CT
Issue related to component testing
stage: needs investigating
Someone from Cypress needs to look at this
Current behavior
Problem
We have two types of component tests, and we want to run them separately, while using the same
cypress.config.ts
.Ideally, one such run would look like:
However, such runs don't match any specs. (however, files like those exist)
Workaround
Specifying the
specPattern
via the JSON--config
works.yarn cypress run --component --config '{ "component": {"specPattern":["**/*.type-1.tsx"]}}'
Assumption about what happens
We have used the "problematic" approach for splitting e2e tests. The problem happens only for component tests. My suspicion is that
--config specPattern=['**/*.type-1.tsx']
overrides the propertye2e.specPattern
instead ofcomponent.specPattern
, even when--component
is used. And then the files get excluded, because of cypress' logic:Desired behavior
I would expect that when using
--component
,--config
would override thecomponent
part ofcypress.config.ts
.Test code to reproduce
Not working
yarn cypress run --component --config specPattern=['**/*.type-1.tsx']
Working
yarn cypress run --component --config '{ "component": {"specPattern":["**/*.type-1.tsx"]}}'
Cypress Version
13.7.2
Node version
v20.12.0
Operating System
macOs 14.4.1
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: