@lvce-editor/test-with-playwright-worker 6.0.1 → 6.4.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 +12 -9
  2. package/package.json +1 -2
@@ -1179,6 +1179,7 @@ const startBrowser = async ({
1179
1179
  headless
1180
1180
  });
1181
1181
  const page = await browser.newPage();
1182
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
1182
1183
  signal.addEventListener('abort', async () => {
1183
1184
  await page.close();
1184
1185
  await browser.close();
@@ -1190,6 +1191,8 @@ const startBrowser = async ({
1190
1191
  };
1191
1192
  };
1192
1193
 
1194
+ /* eslint-disable n/no-unsupported-features/es-syntax */
1195
+
1193
1196
  /**
1194
1197
  *
1195
1198
  * @param {{signal:AbortSignal, port:number, serverPath:string, onlyExtension:string, testPath:string}} param0
@@ -1218,10 +1221,12 @@ const startServer = async ({
1218
1221
  }
1219
1222
  console.log('child error', x);
1220
1223
  });
1221
- await new Promise(resolve => {
1222
- child.on('message', resolve);
1223
- });
1224
- // @ts-ignore
1224
+ const {
1225
+ resolve,
1226
+ promise
1227
+ } = Promise.withResolvers();
1228
+ child.on('message', resolve);
1229
+ await promise;
1225
1230
  return child;
1226
1231
  };
1227
1232
 
@@ -1237,7 +1242,6 @@ const setupTests = async ({
1237
1242
  testPath
1238
1243
  }) => {
1239
1244
  const port = await getPort();
1240
- // @ts-ignore
1241
1245
  const {
1242
1246
  browser,
1243
1247
  page
@@ -1253,7 +1257,6 @@ const setupTests = async ({
1253
1257
  onlyExtension,
1254
1258
  testPath
1255
1259
  });
1256
- // @ts-ignore
1257
1260
  return {
1258
1261
  port,
1259
1262
  browser,
@@ -1264,7 +1267,7 @@ const setupTests = async ({
1264
1267
 
1265
1268
  const SIGINT = 'SIGINT';
1266
1269
 
1267
- const tearDownTests = ({
1270
+ const tearDownTests = async ({
1268
1271
  controller,
1269
1272
  child
1270
1273
  }) => {
@@ -1306,8 +1309,8 @@ const runAllTests = async (extensionPath, testPath, cwd, headless, timeout) => {
1306
1309
  const onResult = async result => {
1307
1310
  await rpc.invoke(HandleResult, result);
1308
1311
  };
1309
- const onFinalResult = finalResult => {
1310
- rpc.invoke(HandleFinalResult, finalResult);
1312
+ const onFinalResult = async finalResult => {
1313
+ await rpc.invoke(HandleFinalResult, finalResult);
1311
1314
  };
1312
1315
  await runTests({
1313
1316
  testSrc,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/test-with-playwright-worker",
3
- "version": "6.0.1",
3
+ "version": "6.4.0",
4
4
  "description": "Worker package for test-with-playwright",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,7 +14,6 @@
14
14
  "dependencies": {
15
15
  "@playwright/test": "1.55.0"
16
16
  },
17
- "devDependencies": {},
18
17
  "engines": {
19
18
  "node": ">=22"
20
19
  }