feat(core): support composing multiple extends configs#1060
Conversation
Deploying rstest with
|
| Latest commit: |
302a86b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bf8741a7.rstest.pages.dev |
| Branch Preview URL: | https://feat-extends-array-compositi.rstest.pages.dev |
There was a problem hiding this comment.
Pull request overview
Adds support for composing multiple extends sources in @rstest/core config, enabling users to layer presets/adapters deterministically while keeping local config as the highest-precedence override.
Changes:
- Allow
extendsto accept a single entry or an array of mixedExtendConfig/ExtendConfigFnentries. - Centralize extends resolution in
resolveExtendsand reuse it for both top-level config loading and inline project configs. - Update docs (EN/ZH) and add test coverage for array semantics and function input behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/zh/config/test/extends.mdx | Documents array extends, precedence, and function semantics (ZH). |
| website/docs/en/config/test/extends.mdx | Documents array extends, precedence, and function semantics (EN). |
| website/AGENTS.md | Adds docs guidance for TypeScript signature formatting in documentation. |
| packages/core/tests/extends.test.ts | Adds tests for top-level extends arrays and function input semantics. |
| packages/core/tests/cli/init.test.ts | Adds tests for inline project configs using extends arrays. |
| packages/core/src/types/config.ts | Expands RstestConfig.extends type to accept arrays. |
| packages/core/src/config.ts | Implements resolveExtends to resolve/merge multiple entries. |
| packages/core/src/cli/init.ts | Switches inline project extends handling to resolveExtends. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3630ac1977
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Background
extendsonly accepted a single config source, which made it awkward to compose shared presets and adapter output in one Rstest config.Implementation
extendsto acceptExtendConfig,ExtendConfigFn, or an array of mixed entriesUser Impact
Users can now combine multiple
extendssources in one config while keeping deterministic override behavior.Checklist
Validation
pnpm --filter @rstest/core test -- 'tests/extends.test.ts'pnpm --filter @rstest/core test -- 'tests/cli/init.test.ts'