@lvce-editor/test-with-playwright-worker 22.38.2 → 22.38.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/workerMain.js +8 -3
- package/package.json +1 -1
package/dist/workerMain.js
CHANGED
|
@@ -1452,7 +1452,7 @@ const Cli = 6001;
|
|
|
1452
1452
|
const browserScriptCache = {};
|
|
1453
1453
|
const fileExtensionRegex = /\.[^.]+$/;
|
|
1454
1454
|
const generatedMaskIconClassRegex = /\bMaskIconCustomView[a-z0-9]+\b/g;
|
|
1455
|
-
const localServerUrlRegex = /http:\/\/localhost:\d+/g;
|
|
1455
|
+
const localServerUrlRegex = /http:\/\/(?:localhost|127\.0\.0\.1):\d+/g;
|
|
1456
1456
|
const tagBoundaryRegex = />\s*</g;
|
|
1457
1457
|
const getBrowserScriptCandidates = () => {
|
|
1458
1458
|
return [fileURLToPath(new URL('svgScreenshot.js', import.meta.url)), fileURLToPath(new URL('../../../../../dist/test-with-playwright-worker/dist/svgScreenshot.js', import.meta.url))];
|
|
@@ -1727,6 +1727,10 @@ const getTestState = (testOverlayState, text) => {
|
|
|
1727
1727
|
}
|
|
1728
1728
|
};
|
|
1729
1729
|
|
|
1730
|
+
// Keep the server bind address and browser URLs on the same address family.
|
|
1731
|
+
// Chromium can fall back to IPv4 even when Node resolved localhost to ::1.
|
|
1732
|
+
const testServerHost = '127.0.0.1';
|
|
1733
|
+
|
|
1730
1734
|
/**
|
|
1731
1735
|
* @param {string} absolutePath
|
|
1732
1736
|
* @param {number} port
|
|
@@ -1735,7 +1739,7 @@ const getTestState = (testOverlayState, text) => {
|
|
|
1735
1739
|
const getUrlFromTestFile = (absolutePath, port, traceFocus, traceRendererWorker) => {
|
|
1736
1740
|
const baseName = basename(absolutePath);
|
|
1737
1741
|
const htmlFileName = baseName.slice(0, -'.js'.length) + '.html';
|
|
1738
|
-
const url = new URL(`http
|
|
1742
|
+
const url = new URL(`http://${testServerHost}:${port}/tests/${htmlFileName}`);
|
|
1739
1743
|
if (traceFocus) {
|
|
1740
1744
|
url.searchParams.set('traceFocus', 'true');
|
|
1741
1745
|
}
|
|
@@ -1923,7 +1927,7 @@ const getResultCounts = status => {
|
|
|
1923
1927
|
}
|
|
1924
1928
|
};
|
|
1925
1929
|
const getAllTestsUrl = (port, filter, traceFocus, traceRendererWorker) => {
|
|
1926
|
-
const url = new URL(`http
|
|
1930
|
+
const url = new URL(`http://${testServerHost}:${port}/tests/_all.html`);
|
|
1927
1931
|
if (traceFocus) {
|
|
1928
1932
|
url.searchParams.set('traceFocus', 'true');
|
|
1929
1933
|
}
|
|
@@ -2325,6 +2329,7 @@ const startServer = async ({
|
|
|
2325
2329
|
// signal,
|
|
2326
2330
|
env: {
|
|
2327
2331
|
...process.env,
|
|
2332
|
+
HOST: testServerHost,
|
|
2328
2333
|
ONLY_EXTENSION: onlyExtension,
|
|
2329
2334
|
PORT: String(port),
|
|
2330
2335
|
TEST_PATH: testPath
|