-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Programmatic way to run Vitest #2167
Comments
There is non-documented (because it's not stable) way to programatically run Vitest: import { startVitest } from 'vitest/node'
await startVitest('test', ['filename']) I think this is how WallabyJS uses it. Currently it returns only |
You can also use import { createVitest } from 'vitest/node'
const ctx = await createVitest('test')
await ctx.start(['filename']) All tests results are located in |
Thank you for the fast reply. We are working on a prototype! We'll get back to you for any questions. |
There is a small page describing the public API in the documentation: https://vitest.dev/advanced/api.html |
Clear and concise description of the problem
Is there a way to run Vitest programmatically. For StrykerJS we are investigating support StrykerJS. Ideally we would like to be able to set an global environment right before each test run and be able to recover a global environment variable.
Vitest support is currently the most upvoted issue for us. stryker-mutator/stryker-js#3465
Suggested solution
Alternative
No response
Additional context
We are okay with using a non public API for now and we are willing to do the work 😅
#524
Validations
The text was updated successfully, but these errors were encountered: