diff --git a/package.json b/package.json index 91c00fe..6b26909 100644 --- a/package.json +++ b/package.json @@ -19,14 +19,15 @@ "dev": "rslib -w", "lint": "rslint && prettier -c .", "lint:write": "rslint --fix && prettier -w .", - "test": "playwright test", + "test": "rstest", "bump": "pnpx bumpp" }, "devDependencies": { - "@playwright/test": "^1.61.1", "@rsbuild/core": "^2.1.5", "@rslib/core": "^0.23.2", "@rslint/core": "^0.6.5", + "@rstest/core": "^0.11.1", + "@rstest/playwright": "^0.11.1", "@types/node": "^24.13.3", "playwright": "^1.61.1", "prettier": "^3.9.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e540a17..0487763 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,9 +8,6 @@ importers: .: devDependencies: - '@playwright/test': - specifier: ^1.61.1 - version: 1.61.1 '@rsbuild/core': specifier: ^2.1.5 version: 2.1.5 @@ -20,6 +17,12 @@ importers: '@rslint/core': specifier: ^0.6.5 version: 0.6.5 + '@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.3 version: 24.13.3 @@ -114,11 +117,6 @@ packages: '@emnapi/core': ^1.7.1 '@emnapi/runtime': ^1.7.1 - '@playwright/test@1.61.1': - resolution: {integrity: sha512-8nKv6+0RJSL9FE4jYOEGXnPeM/Hg12qZpmqzZjRh3qM0Y7c3z1mrOTfFLids72RDQYVh9WpLEfR5WdpNX4fkig==} - engines: {node: '>=18'} - hasBin: true - '@rsbuild/core@2.1.5': resolution: {integrity: sha512-7TW4U1SH7VxQZzSTIOzvwj5lo9uNTmGpsmTXFr4axQAE4giLDKP3kVUA1ZW4P3/Mz4QQJJyvZP29mVcb8kZCfg==} engines: {node: ^20.19.0 || >=22.12.0} @@ -275,12 +273,38 @@ packages: '@swc/helpers': 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.3': resolution: {integrity: sha512-Dh8vAsV36ig5wa9OX4pXvMc9D3Veibfw2wix0CUwYODLD8nkj9UsLjASr49nPg+2eKzxhBV+v7L8pXvT4e639Q==} @@ -404,6 +428,10 @@ packages: cpu: [x64] os: [win32] + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} + fsevents@2.3.2: resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -519,10 +547,6 @@ snapshots: '@tybys/wasm-util': 0.10.3 optional: true - '@playwright/test@1.61.1': - dependencies: - playwright: 1.61.1 - '@rsbuild/core@2.1.5': dependencies: '@rspack/core': 2.1.3(@swc/helpers@0.5.23) @@ -639,6 +663,19 @@ snapshots: optionalDependencies: '@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: tslib: 2.8.1 @@ -648,6 +685,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.3': dependencies: undici-types: 7.18.2 @@ -712,6 +756,8 @@ snapshots: '@typescript/typescript-win32-x64@7.0.2': optional: true + assertion-error@2.0.1: {} + fsevents@2.3.2: optional: true diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index d20cc17..eb86c50 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -8,3 +8,4 @@ allowBuilds: minimumReleaseAgeExclude: - typescript - '@typescript/*' + - '@rstest/*' diff --git a/rstest.config.ts b/rstest.config.ts new file mode 100644 index 0000000..0736330 --- /dev/null +++ b/rstest.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from '@rstest/core'; + +export default defineConfig({ + isolate: false, +}); diff --git a/test/basic/index.test.ts b/test/basic/index.test.ts index d09324f..c13855a 100644 --- a/test/basic/index.test.ts +++ b/test/basic/index.test.ts @@ -1,6 +1,6 @@ import { dirname } from 'node:path'; import { fileURLToPath } from 'node:url'; -import { expect, test } from '@playwright/test'; +import { expect, test } from '@rstest/playwright'; import { createRsbuild } from '@rsbuild/core'; import { pluginExample } from '../../src'; import { getRandomPort } from '../helper';