@lvce-editor/test-with-playwright-worker 6.4.0 → 6.7.0

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.
Files changed (2) hide show
  1. package/dist/workerMain.js +13 -8
  2. package/package.json +1 -1
@@ -1145,12 +1145,15 @@ const getPort = () => {
1145
1145
  };
1146
1146
 
1147
1147
  const getPossibleServerPaths = () => {
1148
- const toTry = ['@lvce-editor/server', pathToFileURL(join(process.cwd(), '..', 'server', 'node_modules', '@lvce-editor', 'server', 'index.js')).toString(), pathToFileURL(join(process.cwd(), '..', 'build', 'node_modules', '@lvce-editor', 'server', 'index.js')).toString(), pathToFileURL(join(process.cwd(), '..', '..', '..', 'packages', 'server', 'node_modules', '@lvce-editor', 'server', 'index.js')).toString()];
1149
- // @ts-ignore
1148
+ const cwd = process.cwd();
1149
+ const toTry = ['@lvce-editor/server', pathToFileURL(join(cwd, '..', 'server', 'node_modules', '@lvce-editor', 'server', 'index.js')).toString(), pathToFileURL(join(cwd, '..', 'build', 'node_modules', '@lvce-editor', 'server', 'index.js')).toString(), pathToFileURL(join(cwd, '..', '..', '..', 'packages', 'server', 'node_modules', '@lvce-editor', 'server', 'index.js')).toString()];
1150
1150
  return toTry;
1151
1151
  };
1152
1152
 
1153
- const getServerPath = async () => {
1153
+ const getServerPath = async serverPath => {
1154
+ if (serverPath) {
1155
+ return serverPath;
1156
+ }
1154
1157
  const toTry = getPossibleServerPaths();
1155
1158
  // @ts-ignore
1156
1159
  for (const path of toTry) {
@@ -1239,7 +1242,8 @@ const setupTests = async ({
1239
1242
  signal,
1240
1243
  headless,
1241
1244
  onlyExtension,
1242
- testPath
1245
+ testPath,
1246
+ serverPath
1243
1247
  }) => {
1244
1248
  const port = await getPort();
1245
1249
  const {
@@ -1249,11 +1253,11 @@ const setupTests = async ({
1249
1253
  signal,
1250
1254
  headless
1251
1255
  });
1252
- const serverPath = await getServerPath();
1256
+ const resolvedServerPath = await getServerPath(serverPath);
1253
1257
  const child = await startServer({
1254
1258
  signal,
1255
1259
  port,
1256
- serverPath,
1260
+ serverPath: resolvedServerPath,
1257
1261
  onlyExtension,
1258
1262
  testPath
1259
1263
  });
@@ -1282,7 +1286,7 @@ const tearDownTests = async ({
1282
1286
  * @param {boolean} headless
1283
1287
  * @param {number} headless
1284
1288
  */
1285
- const runAllTests = async (extensionPath, testPath, cwd, headless, timeout) => {
1289
+ const runAllTests = async (extensionPath, testPath, cwd, headless, timeout, serverPath) => {
1286
1290
  string(extensionPath);
1287
1291
  string(testPath);
1288
1292
  string(cwd);
@@ -1302,7 +1306,8 @@ const runAllTests = async (extensionPath, testPath, cwd, headless, timeout) => {
1302
1306
  signal,
1303
1307
  headless,
1304
1308
  onlyExtension: extensionPath,
1305
- testPath
1309
+ testPath,
1310
+ serverPath
1306
1311
  });
1307
1312
  const testSrc = join(testPath, 'src');
1308
1313
  const tests = await getTests(testSrc);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/test-with-playwright-worker",
3
- "version": "6.4.0",
3
+ "version": "6.7.0",
4
4
  "description": "Worker package for test-with-playwright",
5
5
  "repository": {
6
6
  "type": "git",