@lvce-editor/test-with-playwright-worker 22.38.0 → 22.38.2
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 +13 -1
- package/package.json +1 -1
package/dist/workerMain.js
CHANGED
|
@@ -2304,19 +2304,24 @@ const startBrowser = async ({
|
|
|
2304
2304
|
};
|
|
2305
2305
|
};
|
|
2306
2306
|
|
|
2307
|
+
const getServerArgs = link => {
|
|
2308
|
+
return link?.flatMap(path => ['--link', path]) || [];
|
|
2309
|
+
};
|
|
2310
|
+
|
|
2307
2311
|
/**
|
|
2308
2312
|
*
|
|
2309
2313
|
* @param {{signal:AbortSignal, port:number, serverPath:string, onlyExtension:string, testPath:string}} param0
|
|
2310
2314
|
* @returns
|
|
2311
2315
|
*/
|
|
2312
2316
|
const startServer = async ({
|
|
2317
|
+
link,
|
|
2313
2318
|
onlyExtension,
|
|
2314
2319
|
port,
|
|
2315
2320
|
serverPath,
|
|
2316
2321
|
signal,
|
|
2317
2322
|
testPath
|
|
2318
2323
|
}) => {
|
|
2319
|
-
const child = fork(serverPath, {
|
|
2324
|
+
const child = fork(serverPath, getServerArgs(link), {
|
|
2320
2325
|
// signal,
|
|
2321
2326
|
env: {
|
|
2322
2327
|
...process.env,
|
|
@@ -2349,6 +2354,7 @@ const startServer = async ({
|
|
|
2349
2354
|
const setupTests = async ({
|
|
2350
2355
|
browser,
|
|
2351
2356
|
headless,
|
|
2357
|
+
link,
|
|
2352
2358
|
onlyExtension,
|
|
2353
2359
|
serverPath,
|
|
2354
2360
|
signal,
|
|
@@ -2365,6 +2371,9 @@ const setupTests = async ({
|
|
|
2365
2371
|
});
|
|
2366
2372
|
const resolvedServerPath = await getServerPath(serverPath);
|
|
2367
2373
|
const child = await startServer({
|
|
2374
|
+
...(link && link.length > 0 && {
|
|
2375
|
+
link
|
|
2376
|
+
}),
|
|
2368
2377
|
onlyExtension,
|
|
2369
2378
|
port,
|
|
2370
2379
|
serverPath: resolvedServerPath,
|
|
@@ -2631,6 +2640,9 @@ const runAllTests = async (extensionPath, testPath, cwd, browser, headless, time
|
|
|
2631
2640
|
...(runtimeOptions.serverPath && {
|
|
2632
2641
|
serverPath: runtimeOptions.serverPath
|
|
2633
2642
|
}),
|
|
2643
|
+
...(runtimeOptions.link && runtimeOptions.link.length > 0 && {
|
|
2644
|
+
link: runtimeOptions.link
|
|
2645
|
+
}),
|
|
2634
2646
|
signal,
|
|
2635
2647
|
testPath
|
|
2636
2648
|
});
|