For AI agents: the complete documentation index is available at https://rstest.rs/llms.txt, the full documentation bundle is available at https://rstest.rs/llms-full.txt, and this page is available as Markdown at https://rstest.rs/config/test/projects.md.
close
  • English
  • projects

    • Type:
    import type { ProjectConfig } from '@rstest/core';
    
    type InlineProjectConfig = ProjectConfig & { name: string };
    
    type Projects = (string | InlineProjectConfig)[];
    • Default: undefined (runs the root directory as a single project)

    Run multiple test projects in a single Rstest process and combine all results in the output. Each entry in the array can be a directory path, config file path, glob pattern, or inline project configuration object.

    rstest.config.ts
    import { defineConfig, defineInlineProject } from '@rstest/core';
    
    export default defineConfig({
      projects: [
        // Monorepo: each package directory is a project
        'packages/*',
    
        // Inline project config
        defineInlineProject({
          name: 'react',
          include: ['tests/react/**/*.{test,spec}.{js,cjs,mjs,ts,tsx}'],
          testEnvironment: 'jsdom',
        }),
      ],
    });

    Use defineInlineProject() (requires name) for object items in a projects array, and defineProject() (which can infer name) for top-level exports of project config files.

    To run only specific projects from the command line, pass --project <name> (supports wildcards). See Test projects for directory/glob entries, sharing configs, global options, and nested projects.