Conversation
✅ Deploy Preview for rstest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull Request Overview
This PR adds a defineProject helper function to enable TypeScript autocomplete for project-specific configurations, similar to the existing defineConfig function. It also extends the ProjectConfig type to exclude additional root-level configuration options that shouldn't be available at the project level.
- Added
defineProjectfunction with overloads for sync/async/union types to support project-level configuration - Extended
ProjectConfigto excluderesolveSnapshotPath,onConsoleLog, andhideSkippedTestsfrom project-level configs - Fixed documentation comment typo referring to "Rsbuild" instead of "Rstest"
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/core/src/types/config.ts | Expanded ProjectConfig to exclude three additional root-level options (resolveSnapshotPath, onConsoleLog, hideSkippedTests) |
| packages/core/src/index.ts | Added defineProject helper function with type overloads and corrected documentation comment |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| type ProjectConfigAsyncFn = () => Promise<ProjectConfig>; | ||
|
|
||
| type ProjectConfigSyncFn = () => ProjectConfig; | ||
|
|
||
| type RstestProjectConfigExport = |
There was a problem hiding this comment.
The new type aliases ProjectConfigAsyncFn, ProjectConfigSyncFn, and RstestProjectConfigExport are not exported, while the equivalent RstestConfigAsyncFn, RstestConfigSyncFn, and RstestConfigExport types are exported. Consider exporting these types for consistency and to allow consumers to reference them in their own type definitions.
| type ProjectConfigAsyncFn = () => Promise<ProjectConfig>; | |
| type ProjectConfigSyncFn = () => ProjectConfig; | |
| type RstestProjectConfigExport = | |
| export type ProjectConfigAsyncFn = () => Promise<ProjectConfig>; | |
| export type ProjectConfigSyncFn = () => ProjectConfig; | |
| export type RstestProjectConfigExport = |
Summary
defineProjecthelps you to autocomplete configuration types. It accepts a Rstest project config object, or a function that returns a config.Related Links
close: #668
Checklist