-
-
Notifications
You must be signed in to change notification settings - Fork 322
feat: handle vitest workspace configuration #1003
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
feat: handle vitest workspace configuration #1003
Conversation
| }); | ||
|
|
||
| assert(issues.unresolved['vitest.config.ts']['./vitest.integration.setup.mjs']); | ||
| assert(issues.unresolved['vitest.config.ts']['./vitest.unit.setup.ts']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Happy to merge. If you could please touch those (empty) files there? Then this test file and the counters are tidy too 🍃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sure that I understand the counters and issues returned by await main(). When i touch the files, the test fails because they're not unresolved then.
How exactly would touching the files make this test file and counters tidy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I wasn't clear. With "tidy" I meant that the issue counters end up being zero (0). When the files are there (i.e. not unresolved), there are no issues left (only a number of processed/total files). Then we don't need to assert numbers for unresolved etc. which in my mind is "tidy".
|
|
||
| return [...[...environments, ...reporters, ...coverage].map(id => toDependency(id)), ...setupFiles, ...globalSetup]; | ||
| const workspaceDependencies: Input[] = []; | ||
| if (testConfig.workspace !== undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the types for this plugin (https://github.com/webpro-nl/knip/pull/1003/checks#step:6:18)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commit: |
|
Thanks! Only a few lint issues left it seems. |
|
I'm not sure what failed. What can I run locally to ensure that everything is alright? |
|
Here are the commands that can be used for QA and that should go green: https://github.com/webpro-nl/knip/blob/main/.github/DEVELOPMENT.md#qa There's currently one job in Run Knip against external projects that fails, we can ignore that. |
|
Is there anything else I can help with? |
Forgot to update that one, should be Edit: actually it's there, but only in |
|
Thanks Christoph! |
|
My thanks go to you! 👍🏻 |
|
🚀 This pull request is included in v5.47.0. See Release 5.47.0 for release notes. Using Knip in a commercial project? Please consider becoming a sponsor. |
|
This doesn’t account for |
The
vitestplugin is not properly handling workspace configurations.This PR should enable that, and thus detect various things (e.g.
globalSetup,setupFiles,reportersorcoverage.provider) inside aworkspacearray - like in this example: