-
-
Notifications
You must be signed in to change notification settings - Fork 294
Support Vitest projects configuration for dynamic project discovery #1171
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
Conversation
@webpro ready for review |
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! Happy to merge, but I do have a few remarks.
External project configurations now use
Test fixtures simplified and made more realistic
|
84d1a3c
to
515cafc
Compare
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.
Great, happy to see this working. Almost there :)
for (const projectFile of externalProjectFiles) { | ||
inputs.add(toEntry(projectFile)); | ||
inputs.add(toConfig('vitest', projectFile)); | ||
} |
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.
Looks like we can skip creating externalProjectFiles
and add this to inputs directly above:
inputs.add(toConfig('vitest', projectFile, { containingFilePath: options.configFilePath }));
These items are added as entry files automatically (i.e. toEntry
is redundant).
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.
This works?
commit: |
Please see CI for remaining issue: https://github.com/webpro-nl/knip/actions/runs/16342525311. You can run |
Add support for Vitest projects configuration that allows defining test projects through inline configurations and external file patterns. External project files are resolved from glob patterns and their dependencies are correctly assigned to their respective workspace locations. Resolves #1114
772a23d
to
6181b91
Compare
fixed the formatting |
Thank you very much! Let's go 🚀 |
🚀 This pull request is included in v5.62.0. See Release 5.62.0 for release notes. Using Knip in a commercial project? Please consider becoming a sponsor. |
Summary
Adds support for Vitest's
projects
configuration that allows defining test projects through inline configurations and external file patterns. External project files are resolved from glob patterns and their dependencies are correctly assigned to their respective workspace locations.Resolves #1114
Changes
projects
field to VitestConfig interface supporting both inline configs and glob patterns_glob
utilitytoConfig()
for proper workspace assignmentTest plan