type ProjectConfig = Omit<
RstestConfig,
'projects' | 'reporters' | 'pool' | 'isolate' | 'coverage' | 'bail'
>;
type Projects = (string | ProjectConfig)[];[<rootDir>]Define multiple test projects. It can be an array of directories, configuration files, or glob patterns, or an object.
Rstest will run the tests for each project according to the configuration defined in each project, and the test results from all projects will be combined and displayed.
import { defineConfig } from '@rstest/core';
export default defineConfig({
projects: [
// A monorepo: each package directory is a project
'packages/*',
// All projects under the apps directory that provide an rstest config file
'apps/**/rstest.config.ts',
// A specific project directory
'<rootDir>/services/auth',
// A specific project's config file
'./projects/web/rstest.config.ts',
// inline project configs
{
name: 'node',
include: ['tests/node/**/*.{test,spec}.{js,cjs,mjs,ts,tsx}'],
},
{
name: 'react',
include: ['tests/react/**/*.{test,spec}.{js,cjs,mjs,ts,tsx}'],
testEnvironment: 'jsdom',
},
],
});More information about projects can be found in Test projects.