diff --git a/package.json b/package.json index 03197cd..97b3008 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,6 @@ "sockjs-client": "^1.6.1", "style-loader": "^4.0.0", "supertest": "^6.1.3", - "tcp-port-used": "^1.0.2", "typescript": "^5.9.3", "wait-for-expect": "^3.0.2", "webpack": "^5.94.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a819e2b..a34ad9c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -150,9 +150,6 @@ importers: supertest: specifier: ^6.1.3 version: 6.3.4 - tcp-port-used: - specifier: ^1.0.2 - version: 1.0.2 typescript: specifier: ^5.9.3 version: 5.9.3 @@ -959,15 +956,6 @@ packages: supports-color: optional: true - debug@4.3.1: - resolution: {integrity: sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - debug@4.3.7: resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==} engines: {node: '>=6.0'} @@ -986,9 +974,6 @@ packages: supports-color: optional: true - deep-is@0.1.4: - resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - default-browser-id@5.0.0: resolution: {integrity: sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA==} engines: {node: '>=18'} @@ -1390,10 +1375,6 @@ packages: resolution: {integrity: sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==} engines: {node: '>= 12'} - ip-regex@4.3.0: - resolution: {integrity: sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q==} - engines: {node: '>=8'} - ipaddr.js@1.9.1: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} engines: {node: '>= 0.10'} @@ -1447,17 +1428,10 @@ packages: resolution: {integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==} engines: {node: '>=0.10.0'} - is-url@1.2.4: - resolution: {integrity: sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==} - is-wsl@3.1.0: resolution: {integrity: sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==} engines: {node: '>=16'} - is2@2.0.9: - resolution: {integrity: sha512-rZkHeBn9Zzq52sd9IUIV3a5mfwBY+o2HePMh0wkGBM4z4qjvy2GwVxQ6nNXSfw6MmVP6gf1QIlWjiOavhM3x5g==} - engines: {node: '>=v0.10.0'} - isarray@1.0.0: resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} @@ -1573,9 +1547,6 @@ packages: ms@2.0.0: resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} - ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} @@ -2030,9 +2001,6 @@ packages: tar-stream@3.1.7: resolution: {integrity: sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==} - tcp-port-used@1.0.2: - resolution: {integrity: sha512-l7ar8lLUD3XS1V2lfoJlCBaeoaWo/2xfYt81hM7VlvR4RrMVFqfmzfhLVk40hAb368uitje5gPtBRL1m/DGvLA==} - terser-webpack-plugin@5.3.10: resolution: {integrity: sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==} engines: {node: '>= 10.13.0'} @@ -3049,10 +3017,6 @@ snapshots: dependencies: ms: 2.1.3 - debug@4.3.1: - dependencies: - ms: 2.1.2 - debug@4.3.7: dependencies: ms: 2.1.3 @@ -3061,8 +3025,6 @@ snapshots: dependencies: ms: 2.1.3 - deep-is@0.1.4: {} - default-browser-id@5.0.0: {} default-browser@5.2.1: @@ -3495,8 +3457,6 @@ snapshots: jsbn: 1.1.0 sprintf-js: 1.1.3 - ip-regex@4.3.0: {} - ipaddr.js@1.9.1: {} ipaddr.js@2.2.0: {} @@ -3531,18 +3491,10 @@ snapshots: dependencies: isobject: 3.0.1 - is-url@1.2.4: {} - is-wsl@3.1.0: dependencies: is-inside-container: 1.0.0 - is2@2.0.9: - dependencies: - deep-is: 0.1.4 - ip-regex: 4.3.0 - is-url: 1.2.4 - isarray@1.0.0: {} isexe@2.0.0: {} @@ -3630,8 +3582,6 @@ snapshots: ms@2.0.0: {} - ms@2.1.2: {} - ms@2.1.3: {} nano-staged@0.8.0: @@ -4180,13 +4130,6 @@ snapshots: fast-fifo: 1.3.2 streamx: 2.20.1 - tcp-port-used@1.0.2: - dependencies: - debug: 4.3.1 - is2: 2.0.9 - transitivePeerDependencies: - - supports-color - terser-webpack-plugin@5.3.10(webpack@5.94.0): dependencies: '@jridgewell/trace-mapping': 0.3.25 diff --git a/rstest.config.ts b/rstest.config.ts index 549ad20..a225ba6 100644 --- a/rstest.config.ts +++ b/rstest.config.ts @@ -1,16 +1,12 @@ -import path from 'node:path'; import { defineConfig } from '@rstest/core'; -import { version as rspackVersion } from '@rspack/core'; +import { version } from '@rspack/core/package.json'; -const [webpackVersion] = rspackVersion; -const snapshotExtension = `.snap.webpack${webpackVersion}`; +console.log(`Running tests for rspack @${version} \n`); export default defineConfig({ globals: true, include: ['tests/*.test.ts', 'tests/e2e/*.test.js'], exclude: [ - '**/node_modules/**', - '**/dist/**', // TODO: check why this test timeout '/tests/e2e/host.test.js', // TODO: check why this test throw error when run with other tests @@ -27,12 +23,5 @@ export default defineConfig({ testTimeout: process.env.CI ? 120000 : 30000, hookTimeout: 30000, setupFiles: ['./tests/helpers/setup-test.js'], - globalSetup: ['./tests/helpers/global-setup-test.js'], reporters: ['default'], - resolveSnapshotPath: (testPath) => - path.join( - path.dirname(testPath), - '__snapshots__', - `${path.basename(testPath)}${snapshotExtension}`, - ), }); diff --git a/tests/e2e/__snapshots__/allowed-hosts.test.js.snap.webpack5 b/tests/e2e/__snapshots__/allowed-hosts.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/allowed-hosts.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/allowed-hosts.test.js.snap diff --git a/tests/e2e/__snapshots__/api.test.js.snap.webpack5 b/tests/e2e/__snapshots__/api.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/api.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/api.test.js.snap diff --git a/tests/e2e/__snapshots__/app.test.js.snap.webpack5 b/tests/e2e/__snapshots__/app.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/app.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/app.test.js.snap diff --git a/tests/e2e/__snapshots__/built-in-routes.test.js.snap.webpack5 b/tests/e2e/__snapshots__/built-in-routes.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/built-in-routes.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/built-in-routes.test.js.snap diff --git a/tests/e2e/__snapshots__/client-reconnect.test.js.snap.webpack5 b/tests/e2e/__snapshots__/client-reconnect.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/client-reconnect.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/client-reconnect.test.js.snap diff --git a/tests/e2e/__snapshots__/client.test.js.snap.webpack5 b/tests/e2e/__snapshots__/client.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/client.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/client.test.js.snap diff --git a/tests/e2e/__snapshots__/compress.test.js.snap.webpack5 b/tests/e2e/__snapshots__/compress.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/compress.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/compress.test.js.snap diff --git a/tests/e2e/__snapshots__/entry.test.js.snap.webpack5 b/tests/e2e/__snapshots__/entry.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/entry.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/entry.test.js.snap diff --git a/tests/e2e/__snapshots__/headers.test.js.snap.webpack5 b/tests/e2e/__snapshots__/headers.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/headers.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/headers.test.js.snap diff --git a/tests/e2e/__snapshots__/history-api-fallback.test.js.snap.webpack5 b/tests/e2e/__snapshots__/history-api-fallback.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/history-api-fallback.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/history-api-fallback.test.js.snap diff --git a/tests/e2e/__snapshots__/host.test.js.snap.webpack5 b/tests/e2e/__snapshots__/host.test.js.snap.webpack5 deleted file mode 100644 index b678831..0000000 --- a/tests/e2e/__snapshots__/host.test.js.snap.webpack5 +++ /dev/null @@ -1,61 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`host should work using "127.0.0.1" host and "auto" port: console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`host should work using "127.0.0.1" host and "auto" port: page errors 1`] = `[]`; - -exports[`host should work using "127.0.0.1" host and port as number: console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`host should work using "127.0.0.1" host and port as number: page errors 1`] = `[]`; - -exports[`host should work using "127.0.0.1" host and port as string: console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`host should work using "127.0.0.1" host and port as string: page errors 1`] = `[]`; - -exports[`host should work using "localhost" host and "auto" port: console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`host should work using "localhost" host and "auto" port: page errors 1`] = `[]`; - -exports[`host should work using "localhost" host and port as number: console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`host should work using "localhost" host and port as number: page errors 1`] = `[]`; - -exports[`host should work using "localhost" host and port as string: console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`host should work using "localhost" host and port as string: page errors 1`] = `[]`; diff --git a/tests/e2e/__snapshots__/hot-and-live-reload.test.js.snap.webpack5 b/tests/e2e/__snapshots__/hot-and-live-reload.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/hot-and-live-reload.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/hot-and-live-reload.test.js.snap diff --git a/tests/e2e/__snapshots__/ipc.test.js.snap.webpack5 b/tests/e2e/__snapshots__/ipc.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/ipc.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/ipc.test.js.snap diff --git a/tests/e2e/__snapshots__/logging.test.js.snap.webpack5 b/tests/e2e/__snapshots__/logging.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/logging.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/logging.test.js.snap diff --git a/tests/e2e/__snapshots__/mime-types.test.js.snap.webpack5 b/tests/e2e/__snapshots__/mime-types.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/mime-types.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/mime-types.test.js.snap diff --git a/tests/e2e/__snapshots__/module-federation.test.js.snap.webpack5 b/tests/e2e/__snapshots__/module-federation.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/module-federation.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/module-federation.test.js.snap diff --git a/tests/e2e/__snapshots__/multi-compiler.test.js.snap.webpack5 b/tests/e2e/__snapshots__/multi-compiler.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/multi-compiler.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/multi-compiler.test.js.snap diff --git a/tests/e2e/__snapshots__/on-listening.test.js.snap.webpack5 b/tests/e2e/__snapshots__/on-listening.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/on-listening.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/on-listening.test.js.snap diff --git a/tests/e2e/__snapshots__/overlay.test.js.snap.webpack5 b/tests/e2e/__snapshots__/overlay.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/overlay.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/overlay.test.js.snap diff --git a/tests/e2e/__snapshots__/port.test.js.snap.webpack5 b/tests/e2e/__snapshots__/port.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/port.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/port.test.js.snap diff --git a/tests/e2e/__snapshots__/server-and-client-transport.test.js.snap.webpack5 b/tests/e2e/__snapshots__/server-and-client-transport.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/server-and-client-transport.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/server-and-client-transport.test.js.snap diff --git a/tests/e2e/__snapshots__/server.test.js.snap.webpack5 b/tests/e2e/__snapshots__/server.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/server.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/server.test.js.snap diff --git a/tests/e2e/__snapshots__/setup-exit-signals.test.js.snap.webpack5 b/tests/e2e/__snapshots__/setup-exit-signals.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/setup-exit-signals.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/setup-exit-signals.test.js.snap diff --git a/tests/e2e/__snapshots__/setup-middlewares.test.js.snap.webpack5 b/tests/e2e/__snapshots__/setup-middlewares.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/setup-middlewares.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/setup-middlewares.test.js.snap diff --git a/tests/e2e/__snapshots__/static-directory.test.js.snap.webpack5 b/tests/e2e/__snapshots__/static-directory.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/static-directory.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/static-directory.test.js.snap diff --git a/tests/e2e/__snapshots__/static-public-path.test.js.snap.webpack5 b/tests/e2e/__snapshots__/static-public-path.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/static-public-path.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/static-public-path.test.js.snap diff --git a/tests/e2e/__snapshots__/stats.test.js.snap.webpack5 b/tests/e2e/__snapshots__/stats.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/stats.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/stats.test.js.snap diff --git a/tests/e2e/__snapshots__/target.test.js.snap.webpack5 b/tests/e2e/__snapshots__/target.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/target.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/target.test.js.snap diff --git a/tests/e2e/__snapshots__/watch-files.test.js.snap.webpack5 b/tests/e2e/__snapshots__/watch-files.test.js.snap.webpack5 deleted file mode 100644 index 5c63e7b..0000000 --- a/tests/e2e/__snapshots__/watch-files.test.js.snap.webpack5 +++ /dev/null @@ -1,311 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`watchFiles option should not crash if file doesn't exist should reload when file content is changed: console messages 1`] = ` -[ - "Hey.", -] -`; - -exports[`watchFiles option should not crash if file doesn't exist should reload when file content is changed: page errors 1`] = `[]`; - -exports[`watchFiles option should not crash if file doesn't exist should reload when file content is changed: response status 1`] = `200`; - -exports[`watchFiles option should work with array config should reload when file content is changed: console messages 1`] = ` -[ - "Hey.", -] -`; - -exports[`watchFiles option should work with array config should reload when file content is changed: page errors 1`] = `[]`; - -exports[`watchFiles option should work with array config should reload when file content is changed: response status 1`] = `200`; - -exports[`watchFiles option should work with object with multiple paths should reload when file content is changed: console messages 1`] = ` -[ - "Hey.", -] -`; - -exports[`watchFiles option should work with object with multiple paths should reload when file content is changed: page errors 1`] = `[]`; - -exports[`watchFiles option should work with object with multiple paths should reload when file content is changed: response status 1`] = `200`; - -exports[`watchFiles option should work with object with single path should reload when file content is changed: console messages 1`] = ` -[ - "Hey.", -] -`; - -exports[`watchFiles option should work with object with single path should reload when file content is changed: page errors 1`] = `[]`; - -exports[`watchFiles option should work with object with single path should reload when file content is changed: response status 1`] = `200`; - -exports[`watchFiles option should work with options {"interval":400,"poll":200} should reload when file content is changed 1`] = ` -{ - "alwaysStat": true, - "atomic": false, - "followSymlinks": false, - "ignoreInitial": true, - "ignorePermissionErrors": true, - "ignored": undefined, - "interval": 400, - "persistent": true, - "usePolling": true, -} -`; - -exports[`watchFiles option should work with options {"interval":400,"poll":200} should reload when file content is changed: console messages 1`] = ` -[ - "Hey.", -] -`; - -exports[`watchFiles option should work with options {"interval":400,"poll":200} should reload when file content is changed: page errors 1`] = `[]`; - -exports[`watchFiles option should work with options {"interval":400,"poll":200} should reload when file content is changed: response status 1`] = `200`; - -exports[`watchFiles option should work with options {"poll":200} should reload when file content is changed 1`] = ` -{ - "alwaysStat": true, - "atomic": false, - "followSymlinks": false, - "ignoreInitial": true, - "ignorePermissionErrors": true, - "ignored": undefined, - "interval": 200, - "persistent": true, - "usePolling": true, -} -`; - -exports[`watchFiles option should work with options {"poll":200} should reload when file content is changed: console messages 1`] = ` -[ - "Hey.", -] -`; - -exports[`watchFiles option should work with options {"poll":200} should reload when file content is changed: page errors 1`] = `[]`; - -exports[`watchFiles option should work with options {"poll":200} should reload when file content is changed: response status 1`] = `200`; - -exports[`watchFiles option should work with options {"poll":true} should reload when file content is changed 1`] = ` -{ - "alwaysStat": true, - "atomic": false, - "followSymlinks": false, - "ignoreInitial": true, - "ignorePermissionErrors": true, - "ignored": undefined, - "interval": undefined, - "persistent": true, - "usePolling": true, -} -`; - -exports[`watchFiles option should work with options {"poll":true} should reload when file content is changed: console messages 1`] = ` -[ - "Hey.", -] -`; - -exports[`watchFiles option should work with options {"poll":true} should reload when file content is changed: page errors 1`] = `[]`; - -exports[`watchFiles option should work with options {"poll":true} should reload when file content is changed: response status 1`] = `200`; - -exports[`watchFiles option should work with options {"usePolling":false,"interval":200,"poll":400} should reload when file content is changed 1`] = ` -{ - "alwaysStat": true, - "atomic": false, - "followSymlinks": false, - "ignoreInitial": true, - "ignorePermissionErrors": true, - "ignored": undefined, - "interval": 200, - "persistent": true, - "usePolling": false, -} -`; - -exports[`watchFiles option should work with options {"usePolling":false,"interval":200,"poll":400} should reload when file content is changed: console messages 1`] = ` -[ - "Hey.", -] -`; - -exports[`watchFiles option should work with options {"usePolling":false,"interval":200,"poll":400} should reload when file content is changed: page errors 1`] = `[]`; - -exports[`watchFiles option should work with options {"usePolling":false,"interval":200,"poll":400} should reload when file content is changed: response status 1`] = `200`; - -exports[`watchFiles option should work with options {"usePolling":false,"poll":200} should reload when file content is changed 1`] = ` -{ - "alwaysStat": true, - "atomic": false, - "followSymlinks": false, - "ignoreInitial": true, - "ignorePermissionErrors": true, - "ignored": undefined, - "interval": 200, - "persistent": true, - "usePolling": false, -} -`; - -exports[`watchFiles option should work with options {"usePolling":false,"poll":200} should reload when file content is changed: console messages 1`] = ` -[ - "Hey.", -] -`; - -exports[`watchFiles option should work with options {"usePolling":false,"poll":200} should reload when file content is changed: page errors 1`] = `[]`; - -exports[`watchFiles option should work with options {"usePolling":false,"poll":200} should reload when file content is changed: response status 1`] = `200`; - -exports[`watchFiles option should work with options {"usePolling":false,"poll":true} should reload when file content is changed 1`] = ` -{ - "alwaysStat": true, - "atomic": false, - "followSymlinks": false, - "ignoreInitial": true, - "ignorePermissionErrors": true, - "ignored": undefined, - "interval": undefined, - "persistent": true, - "usePolling": false, -} -`; - -exports[`watchFiles option should work with options {"usePolling":false,"poll":true} should reload when file content is changed: console messages 1`] = ` -[ - "Hey.", -] -`; - -exports[`watchFiles option should work with options {"usePolling":false,"poll":true} should reload when file content is changed: page errors 1`] = `[]`; - -exports[`watchFiles option should work with options {"usePolling":false,"poll":true} should reload when file content is changed: response status 1`] = `200`; - -exports[`watchFiles option should work with options {"usePolling":false} should reload when file content is changed 1`] = ` -{ - "alwaysStat": true, - "atomic": false, - "followSymlinks": false, - "ignoreInitial": true, - "ignorePermissionErrors": true, - "ignored": undefined, - "interval": undefined, - "persistent": true, - "usePolling": false, -} -`; - -exports[`watchFiles option should work with options {"usePolling":false} should reload when file content is changed: console messages 1`] = ` -[ - "Hey.", -] -`; - -exports[`watchFiles option should work with options {"usePolling":false} should reload when file content is changed: page errors 1`] = `[]`; - -exports[`watchFiles option should work with options {"usePolling":false} should reload when file content is changed: response status 1`] = `200`; - -exports[`watchFiles option should work with options {"usePolling":true,"interval":200,"poll":400} should reload when file content is changed 1`] = ` -{ - "alwaysStat": true, - "atomic": false, - "followSymlinks": false, - "ignoreInitial": true, - "ignorePermissionErrors": true, - "ignored": undefined, - "interval": 200, - "persistent": true, - "usePolling": true, -} -`; - -exports[`watchFiles option should work with options {"usePolling":true,"interval":200,"poll":400} should reload when file content is changed: console messages 1`] = ` -[ - "Hey.", -] -`; - -exports[`watchFiles option should work with options {"usePolling":true,"interval":200,"poll":400} should reload when file content is changed: page errors 1`] = `[]`; - -exports[`watchFiles option should work with options {"usePolling":true,"interval":200,"poll":400} should reload when file content is changed: response status 1`] = `200`; - -exports[`watchFiles option should work with options {"usePolling":true,"poll":200} should reload when file content is changed 1`] = ` -{ - "alwaysStat": true, - "atomic": false, - "followSymlinks": false, - "ignoreInitial": true, - "ignorePermissionErrors": true, - "ignored": undefined, - "interval": 200, - "persistent": true, - "usePolling": true, -} -`; - -exports[`watchFiles option should work with options {"usePolling":true,"poll":200} should reload when file content is changed: console messages 1`] = ` -[ - "Hey.", -] -`; - -exports[`watchFiles option should work with options {"usePolling":true,"poll":200} should reload when file content is changed: page errors 1`] = `[]`; - -exports[`watchFiles option should work with options {"usePolling":true,"poll":200} should reload when file content is changed: response status 1`] = `200`; - -exports[`watchFiles option should work with options {"usePolling":true} should reload when file content is changed 1`] = ` -{ - "alwaysStat": true, - "atomic": false, - "followSymlinks": false, - "ignoreInitial": true, - "ignorePermissionErrors": true, - "ignored": undefined, - "interval": undefined, - "persistent": true, - "usePolling": true, -} -`; - -exports[`watchFiles option should work with options {"usePolling":true} should reload when file content is changed: console messages 1`] = ` -[ - "Hey.", -] -`; - -exports[`watchFiles option should work with options {"usePolling":true} should reload when file content is changed: page errors 1`] = `[]`; - -exports[`watchFiles option should work with options {"usePolling":true} should reload when file content is changed: response status 1`] = `200`; - -exports[`watchFiles option should work with string and glob should reload when file content is changed: console messages 1`] = ` -[ - "Hey.", -] -`; - -exports[`watchFiles option should work with string and glob should reload when file content is changed: page errors 1`] = `[]`; - -exports[`watchFiles option should work with string and glob should reload when file content is changed: response status 1`] = `200`; - -exports[`watchFiles option should work with string and path to directory should reload when file content is changed: console messages 1`] = ` -[ - "Hey.", -] -`; - -exports[`watchFiles option should work with string and path to directory should reload when file content is changed: page errors 1`] = `[]`; - -exports[`watchFiles option should work with string and path to directory should reload when file content is changed: response status 1`] = `200`; - -exports[`watchFiles option should work with string and path to file should reload when file content is changed: console messages 1`] = ` -[ - "Hey.", -] -`; - -exports[`watchFiles option should work with string and path to file should reload when file content is changed: page errors 1`] = `[]`; - -exports[`watchFiles option should work with string and path to file should reload when file content is changed: response status 1`] = `200`; diff --git a/tests/e2e/__snapshots__/web-socket-communication.test.js.snap.webpack5 b/tests/e2e/__snapshots__/web-socket-communication.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/web-socket-communication.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/web-socket-communication.test.js.snap diff --git a/tests/e2e/__snapshots__/web-socket-server-url.test.js.snap.webpack5 b/tests/e2e/__snapshots__/web-socket-server-url.test.js.snap.webpack5 deleted file mode 100644 index 5060f13..0000000 --- a/tests/e2e/__snapshots__/web-socket-server-url.test.js.snap.webpack5 +++ /dev/null @@ -1,710 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`web socket server URL should not work and output disconnect wrong web socket URL ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", - "Failed to load resource: net::ERR_NAME_NOT_RESOLVED", - "[rspack-dev-server] Disconnected!", -] -`; - -exports[`web socket server URL should not work and output disconnect wrong web socket URL ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should not work and output disconnect wrong web socket URL ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", - "WebSocket connection to 'ws://unknown.unknown:/unknown' failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED", - "[rspack-dev-server] JSHandle@object", - "[rspack-dev-server] Disconnected!", -] -`; - -exports[`web socket server URL should not work and output disconnect wrong web socket URL ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work and throw an error on invalid web socket URL ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", -] -`; - -exports[`web socket server URL should work and throw an error on invalid web socket URL ("sockjs"): page errors 1`] = ` -[ - "The URL's scheme must be either 'http:' or 'https:'. 'unknown:' is not allowed.", -] -`; - -exports[`web socket server URL should work and throw an error on invalid web socket URL ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", -] -`; - -exports[`web socket server URL should work and throw an error on invalid web socket URL ("ws"): page errors 1`] = ` -[ - "SyntaxError: Failed to construct 'WebSocket': The URL's scheme must be either 'http', 'https', 'ws', or 'wss'. 'unknown' is not allowed.", -] -`; - -exports[`web socket server URL should work behind proxy, when hostnames are different and ports are different ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work behind proxy, when hostnames are different and ports are different ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work behind proxy, when hostnames are different and ports are different ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work behind proxy, when hostnames are different and ports are different ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work behind proxy, when hostnames are different and ports are same ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work behind proxy, when hostnames are different and ports are same ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work behind proxy, when hostnames are different and ports are same ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work behind proxy, when hostnames are different and ports are same ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work behind proxy, when hostnames are same and ports are different ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work behind proxy, when hostnames are same and ports are different ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work behind proxy, when hostnames are same and ports are different ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work behind proxy, when hostnames are same and ports are different ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work behind proxy, when the "host" option is "local-ip" and the "port" option is "auto" ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work behind proxy, when the "host" option is "local-ip" and the "port" option is "auto" ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work behind proxy, when the "host" option is "local-ip" and the "port" option is "auto" ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work behind proxy, when the "host" option is "local-ip" and the "port" option is "auto" ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work when "host" option is "local-ip" ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work when "host" option is "local-ip" ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work when "host" option is "local-ip" ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work when "host" option is "local-ip" ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work when "host" option is "local-ipv4" ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work when "host" option is "local-ipv4" ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work when "host" option is "local-ipv4" ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work when "host" option is "local-ipv4" ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work when "host" option is IPv4 ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work when "host" option is IPv4 ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work when "host" option is IPv4 ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work when "host" option is IPv4 ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work when "port" option is "auto" ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work when "port" option is "auto" ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work when "port" option is "auto" ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work when "port" option is "auto" ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with "client.webSocketURL.*" options ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with "client.webSocketURL.*" options ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with "client.webSocketURL.*" options ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with "client.webSocketURL.*" options ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with "client.webSocketURL.port" and "webSocketServer.options.port" options as string ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with "client.webSocketURL.port" and "webSocketServer.options.port" options as string ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with "client.webSocketURL.port" and "webSocketServer.options.port" options as string ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with "client.webSocketURL.port" and "webSocketServer.options.port" options as string ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with "server: 'https'" option ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with "server: 'https'" option ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with "server: 'https'" option ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with "server: 'https'" option ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with "server: 'spdy'" option ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with "server: 'spdy'" option ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with "server: 'spdy'" option ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with "server: 'spdy'" option ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with default "/ws" value of the "client.webSocketURL.pathname" option ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with default "/ws" value of the "client.webSocketURL.pathname" option ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with default "/ws" value of the "client.webSocketURL.pathname" option ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with default "/ws" value of the "client.webSocketURL.pathname" option ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL" option as "string" ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL" option as "string" ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL" option as "string" ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL" option as "string" ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.host" option ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.host" option ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.host" option ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.host" option ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.host" option using "0.0.0.0" value ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.host" option using "0.0.0.0" value ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.host" option using "0.0.0.0" value ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.host" option using "0.0.0.0" value ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.password" option ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.password" option ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.password" option ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.password" option ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and the custom web socket server "path" ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and the custom web socket server "path" ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and the custom web socket server "path" ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and the custom web socket server "path" ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and the custom web socket server "path" ending with slash ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and the custom web socket server "path" ending with slash ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and the custom web socket server "path" ending with slash ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and the custom web socket server "path" ending with slash ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and the custom web socket server "path" ending without slash ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and the custom web socket server "path" ending without slash ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and the custom web socket server "path" ending without slash ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and the custom web socket server "path" ending without slash ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and the custom web socket server "path" using empty value ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and the custom web socket server "path" using empty value ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and the custom web socket server "path" using empty value ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and the custom web socket server "path" using empty value ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and the custom web socket server "prefix" for compatibility with "sockjs" ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and the custom web socket server "prefix" for compatibility with "sockjs" ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and the custom web socket server "prefix" for compatibility with "sockjs" ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and the custom web socket server "prefix" for compatibility with "sockjs" ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.port" option ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.port" option ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.port" option ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.port" option ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.port" option as string ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.port" option as string ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.port" option as string ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.port" option as string ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.port" option using "0" value ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.port" option using "0" value ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.port" option using "0" value ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.port" option using "0" value ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.protocol" option ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.protocol" option ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.protocol" option ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.protocol" option ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.protocol" option using "auto:" value ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.protocol" option using "auto:" value ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.protocol" option using "auto:" value ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.protocol" option using "auto:" value ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.protocol" option using "http:" value and covert to "ws:" ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.protocol" option using "http:" value and covert to "ws:" ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.protocol" option using "http:" value and covert to "ws:" ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.protocol" option using "http:" value and covert to "ws:" ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.username" and "client.webSocketURL.password" option ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.username" and "client.webSocketURL.password" option ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.username" and "client.webSocketURL.password" option ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.username" and "client.webSocketURL.password" option ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.username" option ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.username" option ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the "client.webSocketURL.username" option ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the "client.webSocketURL.username" option ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the custom web socket server "path" ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the custom web socket server "path" ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the custom web socket server "path" ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the custom web socket server "path" ("ws"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the custom web socket server "path" using empty value ("sockjs"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the custom web socket server "path" using empty value ("sockjs"): page errors 1`] = `[]`; - -exports[`web socket server URL should work with the custom web socket server "path" using empty value ("ws"): console messages 1`] = ` -[ - "[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", - "[HMR] Waiting for update signal from WDS...", - "Hey.", -] -`; - -exports[`web socket server URL should work with the custom web socket server "path" using empty value ("ws"): page errors 1`] = `[]`; diff --git a/tests/e2e/__snapshots__/web-socket-server.test.js.snap.webpack5 b/tests/e2e/__snapshots__/web-socket-server.test.js.snap similarity index 100% rename from tests/e2e/__snapshots__/web-socket-server.test.js.snap.webpack5 rename to tests/e2e/__snapshots__/web-socket-server.test.js.snap diff --git a/tests/helpers/global-setup-test.js b/tests/helpers/global-setup-test.js deleted file mode 100644 index 38bf242..0000000 --- a/tests/helpers/global-setup-test.js +++ /dev/null @@ -1,7 +0,0 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -const tcpPortUsed = require('tcp-port-used'); -const { webpackVersion } = require('@rspack/core/package.json'); -const ports = require('./ports-map'); - -// eslint-disable-next-line no-console -console.log(`\n Running tests for webpack @${webpackVersion} \n`);