Repository navigation
Read the config passed to wdio run - #2389
Conversation
commit: |
webpro
left a comment
There was a problem hiding this comment.
Thanks, Éverton! This picks up custom WDIO configs. Two supported flag aliases still need to be declared.
|
|
||
| const args: Args = { | ||
| binaries: ['wdio'], | ||
| boolean: ['cpuProf', 'headless', 'heapProf'], |
There was a problem hiding this comment.
WDIO's yargs parser also accepts --cpu-prof and --heap-prof, but only the camelCase forms are declared here. With wdio run --cpu-prof ./config/wdio.e2e.ts, Knip consumes the config filename as the flag's value, so the config and its framework dependency remain reported as unused. --heap-prof has the same issue.
Could you declare these aliases and add coverage with each flag before the config path?
There was a problem hiding this comment.
Declared cpu-prof and heap-prof as aliases and added a case for each flag before the config path.
webpro
left a comment
There was a problem hiding this comment.
Thanks for adding both aliases and the regression cases, Éverton. --cpu-prof and --heap-prof now leave the config path intact. LGTM!
|
🚀 This pull request is included in v6.46.0. See Release 6.46.0 for release notes. Using Knip in a commercial project? Please consider becoming a sponsor. |
In google-docs-to-markdown,
wdio run ./wdio.conf.unit.js --coverageandwdio run ./wdio.conf.e2e.jsleave the configs and the runner, framework and reporter packages they name reported as unused, since the plugin only looks forwdio.conf.{js,cjs,mjs,ts,cts,mts}.wdio <config>is the same aswdio run <config>(source). The plugin now reads the config in both forms, and declares the boolean flags ofrun, such as--headless, so they don't take the path as their value. With the configs read,@wdio/config, which they import without listing it, shows up as unlisted.