Conversation
✅ Deploy Preview for rstest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
|
Co-authored-by: fi3ework <12322740+fi3ework@users.noreply.github.com>
Co-authored-by: fi3ework <12322740+fi3ework@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds documentation for the rs.hoisted feature that was implemented in PR #717. The rs.hoisted helper function allows creating values that can be accessed in hoisted functions like rs.mock factory functions, solving the problem of needing to use rs utilities (like rs.fn()) within mock factory functions.
Key Changes
- Added comprehensive documentation for
rs.hoistedAPI including its type signature, usage description, and practical example - Documentation provided in both English and Chinese versions
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| website/docs/en/api/rstest/mock-modules.mdx | Added English documentation for rs.hoisted including type signature, description, code example, and explanation |
| website/docs/zh/api/rstest/mock-modules.mdx | Added Chinese documentation for rs.hoisted with equivalent content to the English version |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ## rs.hoisted | ||
|
|
||
| - **类型**: `<T = unknown>(fn: () => T) => T` |
There was a problem hiding this comment.
The formatting of the type label should be - **类型:** (with a Chinese colon inside the bold text) to be consistent with the documentation style used in other files like fake-timers.mdx, mock-functions.mdx, and mock-instance.mdx. Currently it uses - **类型**: (with an English colon outside the bold).
| - **类型**: `<T = unknown>(fn: () => T) => T` | |
| - **类型:** `<T = unknown>(fn: () => T) => T` |
There was a problem hiding this comment.
Fixed in ed1bc27 to use - **类型:** format consistent with other documentation files.
|
@copilot make a decent title for this PR. |
Co-authored-by: fi3ework <12322740+fi3ework@users.noreply.github.com>
Suggested PR title: This follows the conventional commit format and clearly describes the change. The work is complete and ready for review. |
|
@copilot search all |
Co-authored-by: fi3ework <12322740+fi3ework@users.noreply.github.com>
Fixed in c5d0395. Replaced all 7 occurrences of |
Summary
This PR adds documentation for the
rs.hoistedfeature that was implemented in PR #717 but was missing documentation.The
rs.hoistedhelper function allows creating values that can be accessed in hoisted functions likers.mockfactory functions. It provides access torsutilities (likers.fn()) within the hoisted scope, solving the problem of needing to use these utilities within mock factory functions.Changes Made
rs.hoistedAPI including type signature, usage description, and practical example**类型**:to**类型:**(Chinese colon inside bold)**类型:**:to**类型:**in 7 locations)Example Usage
Related Links
rs.hoisted#717Checklist
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.