UXP Toolkit
    Preparing search index...
    • Create a Vitest pool that runs tests in Adobe UXP environments (Photoshop, etc.).

      This pool wraps @bubblydoo/vitest-pool-cdp and @bubblydoo/uxp-devtools-common to provide a simple way to run Vitest tests inside UXP.

      IMPORTANT: Adobe's Vulcan system only supports a single connection per process. You MUST use isolate: false and fileParallelism: false in your vitest config to prevent multiple workers from trying to initialize Vulcan simultaneously.

      Parameters

      Returns PoolRunnerInitializer

      A PoolRunnerInitializer for Vitest

      // vitest.config.ts
      import { defineConfig } from "vitest/config";
      import { uxpPool } from "@bubblydoo/vitest-pool-uxp";

      export default defineConfig({
      test: {
      include: ['src/**/*.uxp-test.ts'],
      pool: uxpPool(),
      // Required: UXP/Vulcan only supports a single connection
      isolate: false,
      fileParallelism: false,
      testTimeout: 30000,
      watch: false,
      },
      });
      // With custom plugin
      import { uxpPool } from "@bubblydoo/vitest-pool-uxp";

      export default defineConfig({
      test: {
      pool: uxpPool({
      pluginPath: "./my-uxp-plugin",
      debug: true,
      }),
      isolate: false,
      fileParallelism: false,
      },
      });