-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Description
Clear and concise description of the problem
When developing tools atop of vitest using the programmatic API, tools, like mutation testing frameworks (i.e. StrykerJS), sometimes need to report additional data from the testing environment back to the main process.
Suggested solution
Using a custom vitest.setup.js
import { afterAll } from 'vitest';
afterAll((suite) => {
suite.meta.custom = stuff;
});A tool could use this:
const vitest = await createVitest("test", { watch: false });
vitest.projects[0].config.setupFiles = ["vitest.setup.js"];
await vitest.start();
vitest.state.getFiles()[0].result.meta.custom // per suite/worker we can get the custom data hereAlternative
An rpc approach is also mentioned here: #3017 (reply in thread)
Additional context
The vitest-plugin in StrykerJS currently uses files to communicate between the test environment and the main process. This works, but doesn't support "Browser mode".
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Metadata
Metadata
Assignees
Labels
No labels