Skip to content
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

Allow wildcards in --project option #4747

Closed
4 tasks done
fubhy opened this issue Dec 14, 2023 · 3 comments · Fixed by #5295
Closed
4 tasks done

Allow wildcards in --project option #4747

fubhy opened this issue Dec 14, 2023 · 3 comments · Fixed by #5295
Labels
enhancement New feature or request p2-nice-to-have Not breaking anything but nice to have (priority) pr welcome

Comments

@fubhy
Copy link
Contributor

fubhy commented Dec 14, 2023

Clear and concise description of the problem

When running tests with the --project filter option, it'd be great to be able to pass wildcards (e.g. run all test environments for a monorepo package):

vitest --project effect:*

Suggested solution

Allow simple minimatch patterns in the --project option

Alternative

No response

Additional context

No response

Validations

@sheremet-va
Copy link
Member

Not sure this is a good idea. You can pass down several projects by providing this flag several times already: --project nameA --project nameB.

I don't see a world where there are too many projects that you can't pass them down.

@fubhy
Copy link
Contributor Author

fubhy commented Dec 14, 2023

I am currently setting up vitest workspaces for our future monorepo for the effect organization (https://github.com/Effect-TS/effect)

Since this is essentially a runtime & standard lib that is supposed to run flawlessly in all environments (browsers, edge, node, bun, deno, etc.), we intend to configure it in a way where the same packages are covered by multiple project configs.

For instance:

// effect package:
effect:node
effect:chromium
effect:edge
...

// @effect/schema package:
@effect/schema:node
@effect/schema:chromium
@effect/schema:edge
...

... etc.

I think this illustrates how, with e.g. 10+ packages within the monorepo at some point in the near future, this'd already blow up quite a bit.

With a wildcard, we could then easily run the full test environment range for a single project.

e.g. vitest --project "@effect/schema:*"

@sheremet-va sheremet-va added enhancement New feature or request pr welcome p2-nice-to-have Not breaking anything but nice to have (priority) labels Jan 3, 2024
@sheremet-va
Copy link
Member

e.g. vitest --project "@effect/schema:*"

Ok, I think we can support this.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request p2-nice-to-have Not breaking anything but nice to have (priority) pr welcome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants