@chromatic-com/vitest 0.0.2 → 0.0.3-6faf415-20260428084449

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/plugin.js +6 -2
  2. package/package.json +1 -1
package/dist/plugin.js CHANGED
@@ -4155,7 +4155,7 @@ function createCommands(options) {
4155
4155
  };
4156
4156
  }
4157
4157
  await writeTestResult({
4158
- outputDir: resolve(context.project.config.root, options.outputDirectory),
4158
+ outputDir: resolve(context.project.vitest.config.root, options.outputDirectory),
4159
4159
  pageUrl: context.page.url(),
4160
4160
  titlePath: getNames(entity)
4161
4161
  }, snapshotBuffers, archive, {
@@ -4223,6 +4223,10 @@ function getNames(test) {
4223
4223
  if (current.type === "module") {
4224
4224
  names.unshift(current.relativeModuleId);
4225
4225
  }
4226
+ const hasManyProjects = test.project.vitest.projects.length > 1;
4227
+ if (hasManyProjects && test.project.name) {
4228
+ names.unshift(test.project.name);
4229
+ }
4226
4230
  return names;
4227
4231
  }
4228
4232
  __name(getNames, "getNames");
@@ -4288,7 +4292,7 @@ function chromaticPlugin(userOptions = {}) {
4288
4292
  await project.browser?.triggerCommand("__chromatic_reset", {});
4289
4293
  });
4290
4294
  function clean() {
4291
- rmSync(resolve2(project.config.root, options.outputDirectory, "chromatic-archives"), {
4295
+ rmSync(resolve2(project.vitest.config.root, options.outputDirectory, "chromatic-archives"), {
4292
4296
  recursive: true,
4293
4297
  force: true
4294
4298
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chromatic-com/vitest",
3
- "version": "0.0.2",
3
+ "version": "0.0.3-6faf415-20260428084449",
4
4
  "description": "Chromatic Visual Regression Testing for Vitest",
5
5
  "repository": {
6
6
  "type": "git",