From b3d5c8128b072fd2a54b80ebc9ffa656260817ec Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 10 Jul 2026 16:18:16 +0800 Subject: [PATCH 1/2] chore: migrate tests to Rstest --- package.json | 5 +- pnpm-lock.yaml | 248 ++++++++++++++++++++++++++++++++++++++++---- pnpm-workspace.yaml | 3 + rstest.config.ts | 10 ++ test/index.test.ts | 2 +- 5 files changed, 243 insertions(+), 25 deletions(-) create mode 100644 rstest.config.ts diff --git a/package.json b/package.json index 8ab2534..3226e1e 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "lint": "rslint && prettier -c .", "lint:write": "rslint --fix && prettier -w .", "prepare": "simple-git-hooks", - "test": "playwright test", + "test": "rstest", "bump": "pnpx bumpp" }, "simple-git-hooks": { @@ -38,12 +38,13 @@ "yaml": "^2.9.0" }, "devDependencies": { - "@playwright/test": "^1.61.1", "@rsbuild/core": "^2.1.2", "@rsbuild/plugin-react": "^2.1.0", "@rsbuild/plugin-type-check": "^1.5.0", "@rslib/core": "^0.23.1", "@rslint/core": "^0.6.4", + "@rstest/core": "^0.11.1", + "@rstest/playwright": "^0.11.1", "@types/node": "^24.13.2", "@types/react": "^19.2.17", "@types/react-dom": "^19.2.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6667c90..06b1836 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,24 +18,27 @@ importers: specifier: ^2.9.0 version: 2.9.0 devDependencies: - '@playwright/test': - specifier: ^1.61.1 - version: 1.61.1 '@rsbuild/core': specifier: ^2.1.2 version: 2.1.2 '@rsbuild/plugin-react': specifier: ^2.1.0 - version: 2.1.0(@rsbuild/core@2.1.2)(@rspack/core@2.1.2(@swc/helpers@0.5.23)) + version: 2.1.0(@rsbuild/core@2.1.2)(@rspack/core@2.1.3(@swc/helpers@0.5.23)) '@rsbuild/plugin-type-check': specifier: ^1.5.0 - version: 1.5.0(@rsbuild/core@2.1.2)(@rspack/core@2.1.2(@swc/helpers@0.5.23))(tslib@2.8.1)(typescript@6.0.3) + version: 1.5.0(@rsbuild/core@2.1.2)(@rspack/core@2.1.3(@swc/helpers@0.5.23))(tslib@2.8.1)(typescript@6.0.3) '@rslib/core': specifier: ^0.23.1 version: 0.23.1(typescript@6.0.3) '@rslint/core': specifier: ^0.6.4 version: 0.6.4 + '@rstest/core': + specifier: ^0.11.1 + version: 0.11.1 + '@rstest/playwright': + specifier: ^0.11.1 + version: 0.11.1(@rstest/core@0.11.1)(playwright@1.61.1) '@types/node': specifier: ^24.13.2 version: 24.13.2 @@ -299,11 +302,6 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} - '@playwright/test@1.61.1': - resolution: {integrity: sha512-8nKv6+0RJSL9FE4jYOEGXnPeM/Hg12qZpmqzZjRh3qM0Y7c3z1mrOTfFLids72RDQYVh9WpLEfR5WdpNX4fkig==} - engines: {node: '>=18'} - hasBin: true - '@rsbuild/core@2.1.2': resolution: {integrity: sha512-EP24Oj01bdwtw/Xl3LiaLe/WG6PBQV2yWbbCh+2TkMDc9dNHiyBTnR+/JZvGxI8RdO5qU0rH4YgMOJ6nVXIQSA==} engines: {node: ^20.19.0 || >=22.12.0} @@ -314,6 +312,16 @@ packages: core-js: optional: true + '@rsbuild/core@2.1.5': + resolution: {integrity: sha512-7TW4U1SH7VxQZzSTIOzvwj5lo9uNTmGpsmTXFr4axQAE4giLDKP3kVUA1ZW4P3/Mz4QQJJyvZP29mVcb8kZCfg==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + core-js: '>= 3.0.0' + peerDependenciesMeta: + core-js: + optional: true + '@rsbuild/plugin-react@2.1.0': resolution: {integrity: sha512-RQTIAWB/CwPjoWt9iAl+8HixeQVgZ7kEIBrWPCixfITyHdiD84h0YpUTpEUuz6kGHw1KXT9mHZ3Rwy6WG7aRDA==} peerDependencies: @@ -404,69 +412,137 @@ packages: cpu: [arm64] os: [darwin] + '@rspack/binding-darwin-arm64@2.1.3': + resolution: {integrity: sha512-oOGI0RSL89Ehu9T22rugmfUY9OC2eBqLMeWRYsu7bhlUrjoXeVfGBBSEXCse666BQ1sAiM8hD/k7nqVria/okQ==} + cpu: [arm64] + os: [darwin] + '@rspack/binding-darwin-x64@2.1.2': resolution: {integrity: sha512-aoifkILvx/XEHyvg8yW57xu95nx7f9f/3ah1+RguHSNKcJMcoCep9VX1Ct1N0ftqg8MC0JUObc7xWL5W14hmjA==} cpu: [x64] os: [darwin] + '@rspack/binding-darwin-x64@2.1.3': + resolution: {integrity: sha512-sVqWXNiFTMXAyN362y6IA+eJc8LXZKfHdhEJ/zDuMmRp+u2IvhgaF8tk3vX/OmeB9jydVjySijuiqk8No/FoCA==} + cpu: [x64] + os: [darwin] + '@rspack/binding-linux-arm64-gnu@2.1.2': resolution: {integrity: sha512-My4m40tyJSgiCEf3bB2KIEX710q3nZg99LIjy+8Zxgi3oZTkg1bFmFRusFU5U4eN5408zfSqDDGvjDE3Yv7o4w==} cpu: [arm64] os: [linux] libc: [glibc] + '@rspack/binding-linux-arm64-gnu@2.1.3': + resolution: {integrity: sha512-aCy9Zli/2Qf+Ee5otXfFQ6mhv5fEyn0wIoBVmouqtJoqOO21et6UTtJ+LHLsMDolwGLyHERAljeSFSmYX3/O5A==} + cpu: [arm64] + os: [linux] + libc: [glibc] + '@rspack/binding-linux-arm64-musl@2.1.2': resolution: {integrity: sha512-yt+GGWUH7WPE8K97cRc8OpZhH7Pbj1vU+lkvKbDtF/rR8X9a/bJsA/nBqyUV2oBKOVbrp5I8rFZlnDskMqgvKw==} cpu: [arm64] os: [linux] libc: [musl] + '@rspack/binding-linux-arm64-musl@2.1.3': + resolution: {integrity: sha512-flIE7eluz0d21Fn28EVm3vPwoJooOSqtmjLFVSuOMcoCbwV9clfor195oIrAppp/W7dL/3XquFuVfrsa01Jy8Q==} + cpu: [arm64] + os: [linux] + libc: [musl] + '@rspack/binding-linux-riscv64-gnu@2.1.2': resolution: {integrity: sha512-uys8Jyw8Z3ralvICbN/L/nZfy5qELIwpOY72rhIqhoDYwFcL4fmMaY7WsvUcJOjCB2rqOcWPaWKuF2oPvo9iDQ==} cpu: [riscv64] os: [linux] libc: [glibc] + '@rspack/binding-linux-riscv64-gnu@2.1.3': + resolution: {integrity: sha512-yojg8elye1nhsNeGncw0NrZ4pMGF7NVebR80CLg72TXyzfYwFJlFTdU5yUYb1Gy+JXIvrSCwzQt2QkyiEvmkfg==} + cpu: [riscv64] + os: [linux] + libc: [glibc] + '@rspack/binding-linux-riscv64-musl@2.1.2': resolution: {integrity: sha512-JYNVQwqCaRGQWvjHQYzZkIzQiwllMaJwh4Rdu3ww6W2OJcJUqT08sL1pkOtU0iCxT4VUYiRRcp93VGTGpHr8fg==} cpu: [riscv64] os: [linux] libc: [musl] + '@rspack/binding-linux-riscv64-musl@2.1.3': + resolution: {integrity: sha512-6PvbXb3FOK4X3S5QGvoSW/sqExmsvAoPnQ/YSFrXvTphkXFezA7wnobmGBHT8JQP31hcFRzJHIZSIOKktzSzzg==} + cpu: [riscv64] + os: [linux] + libc: [musl] + '@rspack/binding-linux-x64-gnu@2.1.2': resolution: {integrity: sha512-KDoPy0Msf/JLhxgPPrJQzZeB4Qpqd32em8AP5lSW2s6jR5I35dHgAe9xc2A++EQtnSrU4GTn6DBvFC7q84SihQ==} cpu: [x64] os: [linux] libc: [glibc] + '@rspack/binding-linux-x64-gnu@2.1.3': + resolution: {integrity: sha512-lMXjoGKf0SnviH596fmTszgtnXLHmWOoE90G8grG9MvKVa3pelRmfps5ewZL9s8ENf3NXRfOxIhIf/M9as6MqA==} + cpu: [x64] + os: [linux] + libc: [glibc] + '@rspack/binding-linux-x64-musl@2.1.2': resolution: {integrity: sha512-66hWmIGvn4zCKAYXJE9Bp5SNSLYnLFq2Ke/efE+ZtWy43Dd5vk9AAOmThVGBwdwmIxmGtHGCp+cAuS4G0wu0TA==} cpu: [x64] os: [linux] libc: [musl] + '@rspack/binding-linux-x64-musl@2.1.3': + resolution: {integrity: sha512-0esT35v7pW2ZsJTMc/zDUHwpNXlPqyUCyuiLJvrAAUcdENrgOVe4DmFrgVJ2hwqI4GjeN1VBnGRJ8c+edAHH5w==} + cpu: [x64] + os: [linux] + libc: [musl] + '@rspack/binding-wasm32-wasi@2.1.2': resolution: {integrity: sha512-EB4SqH8DW/E/OmqssNQvnIVGQiVUyYNlA/pcc6Ia4MlTNwu6eNDppcNLrToH+kSZpL4CpHSFfSM3eIsSuar2Rw==} cpu: [wasm32] + '@rspack/binding-wasm32-wasi@2.1.3': + resolution: {integrity: sha512-UsrDjD59UEP0mhfN/Z+uTc3vLgiUvIr+mn92WC1sbQi9gtZohTYvaQYFhWuMkBqsACGcmZp704JAbbSrVrVYCA==} + cpu: [wasm32] + '@rspack/binding-win32-arm64-msvc@2.1.2': resolution: {integrity: sha512-T6Fs/g32MRja/UpCq4AdyPRj8tA0cOkcEa4PrAcn/ztUgK8b/qMVxj5mhMI+n7k+kHZQnpeB1Q4HqdSJi6OocA==} cpu: [arm64] os: [win32] + '@rspack/binding-win32-arm64-msvc@2.1.3': + resolution: {integrity: sha512-42RS/SwKBTkNvXIPZXqTn0yEFN8zwGRfRe/ly0GDvPp/KxpLMFWxJmLxgtoLompU+0UCGvV4KpcBENt3oWs6BA==} + cpu: [arm64] + os: [win32] + '@rspack/binding-win32-ia32-msvc@2.1.2': resolution: {integrity: sha512-OtxkFVz14mVL4QK8QriSELn9B6PaYGHw1jGJwVDEzpu2ZxSHCTQPz9dVE1ekYtREEqZUkRU7Fp7VfhJSmjTt2Q==} cpu: [ia32] os: [win32] + '@rspack/binding-win32-ia32-msvc@2.1.3': + resolution: {integrity: sha512-thk43H1JHHbetNF3txcsGXeOwZi2m6Luf/uVUqNORXjxr5VV8woHAgaAx4QXVZRg70z1VDjd8mBWnHBnKI0FGA==} + cpu: [ia32] + os: [win32] + '@rspack/binding-win32-x64-msvc@2.1.2': resolution: {integrity: sha512-Am+nx9fLF3nzgD/K05Bs1Bb+WO8SFLWAYRbXkymaL1r+RQxjRj7jd5ap2PhGOCcfaNA4yVWkAFvmFP92eRu7bQ==} cpu: [x64] os: [win32] + '@rspack/binding-win32-x64-msvc@2.1.3': + resolution: {integrity: sha512-ObaUcj+BHo/aBL1weyM3orApaHyAR5Phr3YNEpQEifxjZbNKM1iO5X5prN4OqEv3H+7o5e/Wh9Fy3N7Vvd+psA==} + cpu: [x64] + os: [win32] + '@rspack/binding@2.1.2': resolution: {integrity: sha512-/mFcRSUW7Pl19KeaBIujJvZYNJQu0wD5D3aa5h+Qcph26v7nmLYlX7eajIHGi8tt2qTZX1lXifw2KLIXKwYaRQ==} + '@rspack/binding@2.1.3': + resolution: {integrity: sha512-4UGXJqUHmm36tWG1GgFZz3p8sQ5JuSgWI+gq1xPPoihS41uYJL3cXuJnirTeWsmVrusmYZTQhgU3tl3VYGcJYg==} + '@rspack/core@2.1.2': resolution: {integrity: sha512-crpNQKhHfnzrIl4Sa4fjH30Ho5aAPgyqpmJZ41SkUFOzyKHdZKYfE5LF3CMh7MiFQFPPxiiKf5BcpxmtZZx4MQ==} engines: {node: ^20.19.0 || >=22.12.0} @@ -479,6 +555,18 @@ packages: '@swc/helpers': optional: true + '@rspack/core@2.1.3': + resolution: {integrity: sha512-1iGnxLrP+iyY0ZSjLZeQTaxrISpQz4yLyqJPmaF/l4uw27/dBcrloszAeLOJQ9jiv7EJtU0T5zB+LOFPpivIxA==} + engines: {node: ^20.19.0 || >=22.12.0} + peerDependencies: + '@module-federation/runtime-tools': ^0.24.1 || ^2.0.0 + '@swc/helpers': ^0.5.23 + peerDependenciesMeta: + '@module-federation/runtime-tools': + optional: true + '@swc/helpers': + optional: true + '@rspack/lite-tapable@1.1.2': resolution: {integrity: sha512-1OnyWChLGE46YzWyjlmYJssOu/Y0STAnnr2ueKPqDCYTf63GJMs0mxNnCul4dNiVqHYPKv3/fxrTY3IpqoVwZQ==} @@ -491,12 +579,38 @@ packages: '@rspack/core': optional: true + '@rstest/core@0.11.1': + resolution: {integrity: sha512-9iJnDrM/zYuHyk1//CMr/Jer2XughgN3fYagGb1YWpMLUke+E+WXlUPgACwf7OkmIB47/TttbLFK+4zwGDNOFg==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + happy-dom: ^20.8.3 + jsdom: '*' + peerDependenciesMeta: + happy-dom: + optional: true + jsdom: + optional: true + + '@rstest/playwright@0.11.1': + resolution: {integrity: sha512-VhA5SvfYTdC9nJ572Q5NfR8OqcHWr9Agd9zWrkSCBC3sQDwuWLiZTTX4wAv8hMwRtDGzNG0otUPTDrCQ1r0hWQ==} + engines: {node: ^20.19.0 || >=22.12.0} + peerDependencies: + '@rstest/core': workspace:^ + playwright: ^1.49.1 + '@swc/helpers@0.5.23': resolution: {integrity: sha512-5lSsMOTXURePglDfvuAQUqkGek9Hg2kksOYay2m0+XR++b2NWYL/4sWyuvVBIs8oKnJaxkdi9whaL/sqN13afw==} '@tybys/wasm-util@0.10.3': resolution: {integrity: sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==} + '@types/chai@5.2.3': + resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} + + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + '@types/node@24.13.2': resolution: {integrity: sha512-fRa09kZTgu8o71KFcDjUFuc7F+dEbZYZmkI0mg5YBTRs0yMKjYHsq/c0urDKeDb+D5qVgXOdFcuu+DZPKOITwA==} @@ -512,6 +626,10 @@ packages: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} + binary-extensions@2.3.0: resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} engines: {node: '>=8'} @@ -930,10 +1048,6 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 - '@playwright/test@1.61.1': - dependencies: - playwright: 1.61.1 - '@rsbuild/core@2.1.2': dependencies: '@rspack/core': 2.1.2(@swc/helpers@0.5.23) @@ -941,21 +1055,28 @@ snapshots: transitivePeerDependencies: - '@module-federation/runtime-tools' - '@rsbuild/plugin-react@2.1.0(@rsbuild/core@2.1.2)(@rspack/core@2.1.2(@swc/helpers@0.5.23))': + '@rsbuild/core@2.1.5': + dependencies: + '@rspack/core': 2.1.3(@swc/helpers@0.5.23) + '@swc/helpers': 0.5.23 + transitivePeerDependencies: + - '@module-federation/runtime-tools' + + '@rsbuild/plugin-react@2.1.0(@rsbuild/core@2.1.2)(@rspack/core@2.1.3(@swc/helpers@0.5.23))': dependencies: - '@rspack/plugin-react-refresh': 2.0.2(@rspack/core@2.1.2(@swc/helpers@0.5.23))(react-refresh@0.18.0) + '@rspack/plugin-react-refresh': 2.0.2(@rspack/core@2.1.3(@swc/helpers@0.5.23))(react-refresh@0.18.0) react-refresh: 0.18.0 optionalDependencies: '@rsbuild/core': 2.1.2 transitivePeerDependencies: - '@rspack/core' - '@rsbuild/plugin-type-check@1.5.0(@rsbuild/core@2.1.2)(@rspack/core@2.1.2(@swc/helpers@0.5.23))(tslib@2.8.1)(typescript@6.0.3)': + '@rsbuild/plugin-type-check@1.5.0(@rsbuild/core@2.1.2)(@rspack/core@2.1.3(@swc/helpers@0.5.23))(tslib@2.8.1)(typescript@6.0.3)': dependencies: deepmerge: 4.3.1 json5: 2.2.3 reduce-configs: 1.1.2 - ts-checker-rspack-plugin: 1.5.1(@rspack/core@2.1.2(@swc/helpers@0.5.23))(tslib@2.8.1)(typescript@6.0.3) + ts-checker-rspack-plugin: 1.5.1(@rspack/core@2.1.3(@swc/helpers@0.5.23))(tslib@2.8.1)(typescript@6.0.3) optionalDependencies: '@rsbuild/core': 2.1.2 transitivePeerDependencies: @@ -1014,27 +1135,51 @@ snapshots: '@rspack/binding-darwin-arm64@2.1.2': optional: true + '@rspack/binding-darwin-arm64@2.1.3': + optional: true + '@rspack/binding-darwin-x64@2.1.2': optional: true + '@rspack/binding-darwin-x64@2.1.3': + optional: true + '@rspack/binding-linux-arm64-gnu@2.1.2': optional: true + '@rspack/binding-linux-arm64-gnu@2.1.3': + optional: true + '@rspack/binding-linux-arm64-musl@2.1.2': optional: true + '@rspack/binding-linux-arm64-musl@2.1.3': + optional: true + '@rspack/binding-linux-riscv64-gnu@2.1.2': optional: true + '@rspack/binding-linux-riscv64-gnu@2.1.3': + optional: true + '@rspack/binding-linux-riscv64-musl@2.1.2': optional: true + '@rspack/binding-linux-riscv64-musl@2.1.3': + optional: true + '@rspack/binding-linux-x64-gnu@2.1.2': optional: true + '@rspack/binding-linux-x64-gnu@2.1.3': + optional: true + '@rspack/binding-linux-x64-musl@2.1.2': optional: true + '@rspack/binding-linux-x64-musl@2.1.3': + optional: true + '@rspack/binding-wasm32-wasi@2.1.2': dependencies: '@emnapi/core': 1.11.1 @@ -1042,15 +1187,31 @@ snapshots: '@napi-rs/wasm-runtime': 1.1.6(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1) optional: true + '@rspack/binding-wasm32-wasi@2.1.3': + dependencies: + '@emnapi/core': 1.11.1 + '@emnapi/runtime': 1.11.1 + '@napi-rs/wasm-runtime': 1.1.6(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1) + optional: true + '@rspack/binding-win32-arm64-msvc@2.1.2': optional: true + '@rspack/binding-win32-arm64-msvc@2.1.3': + optional: true + '@rspack/binding-win32-ia32-msvc@2.1.2': optional: true + '@rspack/binding-win32-ia32-msvc@2.1.3': + optional: true + '@rspack/binding-win32-x64-msvc@2.1.2': optional: true + '@rspack/binding-win32-x64-msvc@2.1.3': + optional: true + '@rspack/binding@2.1.2': optionalDependencies: '@rspack/binding-darwin-arm64': 2.1.2 @@ -1066,19 +1227,53 @@ snapshots: '@rspack/binding-win32-ia32-msvc': 2.1.2 '@rspack/binding-win32-x64-msvc': 2.1.2 + '@rspack/binding@2.1.3': + optionalDependencies: + '@rspack/binding-darwin-arm64': 2.1.3 + '@rspack/binding-darwin-x64': 2.1.3 + '@rspack/binding-linux-arm64-gnu': 2.1.3 + '@rspack/binding-linux-arm64-musl': 2.1.3 + '@rspack/binding-linux-riscv64-gnu': 2.1.3 + '@rspack/binding-linux-riscv64-musl': 2.1.3 + '@rspack/binding-linux-x64-gnu': 2.1.3 + '@rspack/binding-linux-x64-musl': 2.1.3 + '@rspack/binding-wasm32-wasi': 2.1.3 + '@rspack/binding-win32-arm64-msvc': 2.1.3 + '@rspack/binding-win32-ia32-msvc': 2.1.3 + '@rspack/binding-win32-x64-msvc': 2.1.3 + '@rspack/core@2.1.2(@swc/helpers@0.5.23)': dependencies: '@rspack/binding': 2.1.2 optionalDependencies: '@swc/helpers': 0.5.23 + '@rspack/core@2.1.3(@swc/helpers@0.5.23)': + dependencies: + '@rspack/binding': 2.1.3 + optionalDependencies: + '@swc/helpers': 0.5.23 + '@rspack/lite-tapable@1.1.2': {} - '@rspack/plugin-react-refresh@2.0.2(@rspack/core@2.1.2(@swc/helpers@0.5.23))(react-refresh@0.18.0)': + '@rspack/plugin-react-refresh@2.0.2(@rspack/core@2.1.3(@swc/helpers@0.5.23))(react-refresh@0.18.0)': dependencies: react-refresh: 0.18.0 optionalDependencies: - '@rspack/core': 2.1.2(@swc/helpers@0.5.23) + '@rspack/core': 2.1.3(@swc/helpers@0.5.23) + + '@rstest/core@0.11.1': + dependencies: + '@rsbuild/core': 2.1.5 + '@types/chai': 5.2.3 + transitivePeerDependencies: + - '@module-federation/runtime-tools' + - core-js + + '@rstest/playwright@0.11.1(@rstest/core@0.11.1)(playwright@1.61.1)': + dependencies: + '@rstest/core': 0.11.1 + playwright: 1.61.1 '@swc/helpers@0.5.23': dependencies: @@ -1089,6 +1284,13 @@ snapshots: tslib: 2.8.1 optional: true + '@types/chai@5.2.3': + dependencies: + '@types/deep-eql': 4.0.2 + assertion-error: 2.0.1 + + '@types/deep-eql@4.0.2': {} + '@types/node@24.13.2': dependencies: undici-types: 7.18.2 @@ -1106,6 +1308,8 @@ snapshots: normalize-path: 3.0.0 picomatch: 2.3.1 + assertion-error@2.0.1: {} + binary-extensions@2.3.0: {} braces@3.0.3: @@ -1262,7 +1466,7 @@ snapshots: dependencies: tslib: 2.8.1 - ts-checker-rspack-plugin@1.5.1(@rspack/core@2.1.2(@swc/helpers@0.5.23))(tslib@2.8.1)(typescript@6.0.3): + ts-checker-rspack-plugin@1.5.1(@rspack/core@2.1.3(@swc/helpers@0.5.23))(tslib@2.8.1)(typescript@6.0.3): dependencies: '@rspack/lite-tapable': 1.1.2 chokidar: 3.6.0 @@ -1270,7 +1474,7 @@ snapshots: picocolors: 1.1.1 typescript: 6.0.3 optionalDependencies: - '@rspack/core': 2.1.2(@swc/helpers@0.5.23) + '@rspack/core': 2.1.3(@swc/helpers@0.5.23) transitivePeerDependencies: - tslib diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 7b3c6ba..0cbb096 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -5,3 +5,6 @@ packages: allowBuilds: core-js: false simple-git-hooks: false + +minimumReleaseAgeExclude: + - '@rstest/*' diff --git a/rstest.config.ts b/rstest.config.ts new file mode 100644 index 0000000..70f9593 --- /dev/null +++ b/rstest.config.ts @@ -0,0 +1,10 @@ +import { defineConfig } from '@rstest/core'; + +export default defineConfig({ + env: { + // Let Rsbuild choose the mode based on the command. + NODE_ENV: undefined, + }, + isolate: false, + testTimeout: 30_000, +}); diff --git a/test/index.test.ts b/test/index.test.ts index 4bbf964..f08c495 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -1,6 +1,6 @@ import { dirname, join } from 'node:path'; import { fileURLToPath } from 'node:url'; -import { expect, test } from '@playwright/test'; +import { expect, test } from '@rstest/playwright'; import { createRsbuild, loadConfig } from '@rsbuild/core'; const __dirname = dirname(fileURLToPath(import.meta.url)); From 1bb76d226b55f49b1412878ebc4a9dd2000da644 Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 10 Jul 2026 16:41:21 +0800 Subject: [PATCH 2/2] chore: remove global test timeout --- rstest.config.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/rstest.config.ts b/rstest.config.ts index 70f9593..b68293b 100644 --- a/rstest.config.ts +++ b/rstest.config.ts @@ -6,5 +6,4 @@ export default defineConfig({ NODE_ENV: undefined, }, isolate: false, - testTimeout: 30_000, });