Skip to content

Allow empty instances in browser settings for better projects usage #8645

@michaelhazan

Description

@michaelhazan

Clear and concise description of the problem

Currently it is required to have the instances array include at least one instance of a browser, this causes me to have a shared browser instance between all of my projects (which i'm trying to avoid as i want each of the projects to use a different instance configuration).

Important to note that this still fails even when i'm running a specific project (that has instances configured) like so:

pnpm vitest run --project=<project-name>

Suggested solution

What im suggesting is to allow instances to be empty / undefined and fail only if the project running doesnt have any specified instances, so this behavior will be allowed:

// vite.config.ts

import { defineConfig } from "vitest/config"

export default defineConfig({
    test: {
        //...
        browser: {
            //.. Some sort of custom config that will be shared throughout the projects
            instances: [], // Or not even defined ¯\_(ツ)_/¯
        },
        projects: [{
            extends: true,
            name: "project",

            browser: {
                instances: // This must be defined
            }
        }],
    }
});

Alternative

No response

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions