rstest
rstest copied to clipboard
Remove redundant title attributes from configuration code blocks in Tab components
This PR fixes redundant title="rstest.config.ts" attributes in code blocks that are already wrapped in <Tab label="rstest.config.ts"> components across the documentation.
Problem
Many configuration code blocks were wrapped in Tab components that already declared the filename in their label attribute, making the additional title="rstest.config.ts" attribute redundant and visually cluttered:
<Tab label="rstest.config.ts">
```ts title="rstest.config.ts" <!-- This title is redundant -->
import { defineConfig } from '@rstest/core';
```
Solution
Removed the redundant title="rstest.config.ts" attributes from code blocks that are inside <Tab label="rstest.config.ts"> components, while preserving title attributes for standalone code blocks that are not wrapped in tabs.
Files Changed
- 41 files total: 20 English + 21 Chinese documentation files in
website/docs/{zh,en}/config/test/ - Only code blocks inside Tab components had their redundant titles removed
- Standalone code blocks (not in tabs) retain their title attributes for clarity
Example Change
<Tab label="rstest.config.ts">
- ```ts title="rstest.config.ts"
+ ```ts
import { defineConfig } from '@rstest/core';
export default defineConfig({
globals: true,
});
```
This change eliminates visual redundancy while maintaining clear documentation structure - the Tab label already indicates the filename, so the title attribute is unnecessary.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
Deploy Preview for rstest-dev ready!
| Name | Link |
|---|---|
| Latest commit | 0c1d791532427f3eb849e56af29dc0fe9b681c3b |
| Latest deploy log | https://app.netlify.com/projects/rstest-dev/deploys/68b958e36035070008762a51 |
| Deploy Preview | https://deploy-preview-546--rstest-dev.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
@copilot re-check are the files updated in docs/en identical with docs/zh?
@copilot re-check are the files updated in
docs/enidentical withdocs/zh?
No, the files updated in docs/en are not identical to docs/zh. I found at least one significant difference:
reporters.mdx (line 134):
- EN:
reporters: [['junit', { outputPath: './junit.xml' }]] - ZH:
reporters: ['junit']
The English version shows the full configuration example with outputPath, while the Chinese version shows a simplified example. Both have the title="rstest.config.ts" attribute correctly added, but the configuration content differs.
The text content is properly translated between languages, but some code examples appear to have intentional differences in complexity/completeness.
@copilot do not add the title when it's wrapped in a Tab that already declares the file name, like below
<Tab label="rstest.config.ts">
```ts title="rstest.config.ts"
@copilot do not add the title when it's wrapped in a
Tabthat already declares the file name, like below
...
I've removed the redundant title="rstest.config.ts" attributes from all code blocks that are inside <Tab label="rstest.config.ts"> components. The Tab label already declares the filename, making the title attribute redundant.
Changes made:
- Processed 41 documentation files (20 English + 21 Chinese)
- Only removed titles from code blocks inside Tab components that declare "rstest.config.ts"
- Preserved title attributes for standalone code blocks that are not wrapped in tabs
Fixed in commit 0c1d791.