[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
vitest docs config browser instances.md
1.7 kB


title: browser.instances | Config outline: deep #

browser.instances #

  • Type: BrowserConfig
  • Default: []

Defines multiple browser setups. Every config has to have at least a browser field.

You can specify most of the project options (not marked with a icon) and some of the browser options like browser.testerHtmlPath.

::: warning Every browser config inherits options from the root config:

export default defineConfig({
  test: {
    setupFile: ['./root-setup-file.js'],
    browser: {
      enabled: true,
      testerHtmlPath: './custom-path.html',
      instances: [
        {
          // will have both setup files: "root" and "browser"
          setupFile: ['./browser-setup-file.js'],
          // implicitly has "testerHtmlPath" from the root config // [!code warning]
          // testerHtmlPath: './custom-path.html', // [!code warning]
        },
      ],
    },
  },
})

For more examples, refer to the "Multiple Setups" guide. :::

List of available browser options:

Under the hood, Vitest transforms these instances into separate test projects sharing a single Vite server for better caching performance.