-4

I am using Vitest in browser mode, with Playwright as the provider. Whenever a test fails, a screenshot of the failed test is created in __screenshots__/<filename>/<test-name>. I am unsure if this is a Vitest thing or a Playwright thing, but how do I turn it off?

vitest.config.ts:

import { defineConfig } from "vitest/config";
import { playwright } from "@vitest/browser-playwright";
import path from "path";

export default defineConfig({
  resolve: {
    alias: {
      "~": path.resolve(__dirname, "./app"),
    },
  },
  test: {
    globals: true,
    setupFiles: ["./test-setup.ts"],
    browser: {
      enabled: true,
      provider: playwright(),
      instances: [{ browser: "chromium" }],
      headless: true,
      ui: false,
    },
  },
});

package.json:

  "devDependencies": {
    "@react-router/dev": "^7.5.0",
    "@repo/eslint-config": "workspace:*",
    "@repo/typescript-config": "workspace:*",
    "@testing-library/jest-dom": "^6.9.1",
    "@testing-library/react": "^16.3.0",
    "@testing-library/user-event": "^14.6.1",
    "@types/node": "^22.15.19",
    "@types/react": "^19.0.1",
    "@types/react-dom": "^19.0.1",
    "@vitest/browser-playwright": "^4.0.8",
    "react-router-devtools": "^1.1.0",
    "typescript": "^5.8.2",
    "vite": "^6.4.1",
    "vite-tsconfig-paths": "^5.1.4",
    "vitest": "^4.0.8"
  }
2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.