Skip to content

Commit c19c066

Browse files
fi3eworkampcode-com
andcommitted
feat(rstest): upgrade all rstest packages to 0.9.0 and improve browser-locator example
- Upgrade @rstest/core, @rstest/browser, @rstest/browser-react to ^0.9.1 - Upgrade @rstest/adapter-rsbuild to ^0.2.2, @rstest/adapter-rslib to ^0.2.2 - Upgrade @rstest/coverage-istanbul to ^0.3.0 - Replace canary URLs in browser-locator with stable ^0.9.0 - Standardize coverage package name to @rstest-example/coverage - Remove version mismatch workaround comments in adapter configs - Refactor browser-locator to use React + @rstest/browser-react render() instead of raw DOM Amp-Thread-ID: https://ampcode.com/threads/T-019cb365-cf4b-75c2-957e-8e4c4df7cc66 Co-authored-by: Amp <amp@ampcode.com>
1 parent 64147cf commit c19c066

File tree

21 files changed

+1160
-156
lines changed

21 files changed

+1160
-156
lines changed

pnpm-lock.yaml

Lines changed: 554 additions & 134 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rsbuild/react-rstest/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"devDependencies": {
1717
"@rsbuild/core": "2.0.0-beta.5",
1818
"@rsbuild/plugin-react": "^1.4.5",
19-
"@rstest/core": "^0.8.2",
19+
"@rstest/core": "^0.9.1",
2020
"@testing-library/jest-dom": "^6.9.1",
2121
"@testing-library/react": "^16.3.2",
2222
"@types/react": "^19.2.10",

rslib/node-rstest/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"devDependencies": {
2323
"@rslib/core": "^0.19.6",
24-
"@rstest/core": "^0.8.2",
24+
"@rstest/core": "^0.9.1",
2525
"@types/node": "^24.10.9",
2626
"typescript": "^5.9.3"
2727
}

rslib/react-rstest/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"devDependencies": {
2121
"@rsbuild/plugin-react": "^1.4.5",
2222
"@rslib/core": "^0.19.6",
23-
"@rstest/core": "^0.8.2",
23+
"@rstest/core": "^0.9.1",
2424
"@testing-library/jest-dom": "^6.9.1",
2525
"@testing-library/react": "^16.3.2",
2626
"@types/react": "^19.2.10",

rslib/vue-rstest/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"devDependencies": {
2121
"@rslib/core": "^0.19.6",
22-
"@rstest/core": "^0.8.2",
22+
"@rstest/core": "^0.9.1",
2323
"@testing-library/jest-dom": "^6.9.1",
2424
"@testing-library/vue": "^8.1.0",
2525
"@vue/test-utils": "^2.4.6",
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "@rstest-example/browser-locator",
3+
"version": "1.0.0",
4+
"private": true,
5+
"type": "module",
6+
"scripts": {
7+
"build": "rsbuild build",
8+
"dev": "rsbuild dev",
9+
"test": "rstest",
10+
"test:watch": "rstest --watch"
11+
},
12+
"devDependencies": {
13+
"@rsbuild/core": "2.0.0-beta.5",
14+
"@rsbuild/plugin-react": "^1.4.5",
15+
"@rstest/adapter-rsbuild": "^0.2.2",
16+
"@rstest/browser": "^0.9.1",
17+
"@rstest/browser-react": "^0.9.1",
18+
"@rstest/core": "^0.9.1",
19+
"@types/react": "^19.2.10",
20+
"@types/react-dom": "^19.2.3",
21+
"playwright": "^1.58.1",
22+
"react": "^19.2.4",
23+
"react-dom": "^19.2.4",
24+
"typescript": "^5.9.3"
25+
}
26+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { defineConfig } from '@rsbuild/core';
2+
import { pluginReact } from '@rsbuild/plugin-react';
3+
4+
export default defineConfig({
5+
plugins: [pluginReact()],
6+
source: {
7+
entry: {
8+
index: './src/index.tsx',
9+
},
10+
},
11+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { withRsbuildConfig } from '@rstest/adapter-rsbuild';
2+
import { defineConfig, type ExtendConfigFn } from '@rstest/core';
3+
4+
export default defineConfig({
5+
extends: withRsbuildConfig() as ExtendConfigFn,
6+
browser: {
7+
enabled: true,
8+
provider: 'playwright',
9+
browser: 'chromium',
10+
port: 3013,
11+
},
12+
});
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { StrictMode } from 'react';
2+
import { createRoot } from 'react-dom/client';
3+
4+
function App() {
5+
return (
6+
<>
7+
<h1>Locator API Demo</h1>
8+
<form aria-label="Login form">
9+
<label htmlFor="username">Username</label>
10+
<input id="username" placeholder="Enter username" />
11+
<label htmlFor="password">Password</label>
12+
<input id="password" type="password" placeholder="Enter password" />
13+
<label>
14+
<input id="remember" type="checkbox" />
15+
Remember me
16+
</label>
17+
<button type="button">Login</button>
18+
</form>
19+
</>
20+
);
21+
}
22+
23+
const root = document.getElementById('root');
24+
if (root) {
25+
createRoot(root).render(
26+
<StrictMode>
27+
<App />
28+
</StrictMode>,
29+
);
30+
}

0 commit comments

Comments
 (0)