Skip to content

Instantly share code, notes, and snippets.

@mizchi
Created September 4, 2024 08:21
Show Gist options
  • Save mizchi/c2e8ba6b3f7b23bb5b6f3761437f09b8 to your computer and use it in GitHub Desktop.
Save mizchi/c2e8ba6b3f7b23bb5b6f3761437f09b8 to your computer and use it in GitHub Desktop.
Run unit tests and browser-tests in one config
import { defineWorkspace } from "vitest/config";
export default defineWorkspace([
{
extends: "vite.config.ts",
test: {
name: "unit",
environment: "node",
include: ["src/**/*.test.ts"],
},
},
{
extends: "vite.config.ts",
test: {
include: ["src/**/*.browser-test.ts"],
browser: {
enabled: true,
name: "chromium",
headless: true,
provider: "playwright",
providerOptions: {},
},
},
},
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment