@lvce-editor/test-with-playwright-worker 13.0.0 → 14.1.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 +16 -11
  2. package/package.json +2 -2
@@ -714,14 +714,14 @@ const execute = (command, ...args) => {
714
714
  };
715
715
 
716
716
  const Two = '2.0';
717
- const create$s = (method, params) => {
717
+ const create$t = (method, params) => {
718
718
  return {
719
719
  jsonrpc: Two,
720
720
  method,
721
721
  params
722
722
  };
723
723
  };
724
- const create$r = (id, method, params) => {
724
+ const create$s = (id, method, params) => {
725
725
  const message = {
726
726
  id,
727
727
  jsonrpc: Two,
@@ -731,14 +731,14 @@ const create$r = (id, method, params) => {
731
731
  return message;
732
732
  };
733
733
  let id = 0;
734
- const create$q = () => {
734
+ const create$r = () => {
735
735
  return ++id;
736
736
  };
737
737
 
738
738
  /* eslint-disable n/no-unsupported-features/es-syntax */
739
739
 
740
740
  const registerPromise = map => {
741
- const id = create$q();
741
+ const id = create$r();
742
742
  const {
743
743
  promise,
744
744
  resolve
@@ -756,7 +756,7 @@ const invokeHelper = async (callbacks, ipc, method, params, useSendAndTransfer)
756
756
  id,
757
757
  promise
758
758
  } = registerPromise(callbacks);
759
- const message = create$r(id, method, params);
759
+ const message = create$s(id, method, params);
760
760
  if (useSendAndTransfer && ipc.sendAndTransfer) {
761
761
  ipc.sendAndTransfer(message);
762
762
  } else {
@@ -792,7 +792,7 @@ const createRpc = ipc => {
792
792
  * @deprecated
793
793
  */
794
794
  send(method, ...params) {
795
- const message = create$s(method, params);
795
+ const message = create$t(method, params);
796
796
  ipc.send(message);
797
797
  }
798
798
  };
@@ -828,7 +828,7 @@ const listen = async (module, options) => {
828
828
  const ipc = module.wrap(rawIpc);
829
829
  return ipc;
830
830
  };
831
- const create$6 = async ({
831
+ const create$7 = async ({
832
832
  commandMap
833
833
  }) => {
834
834
  // TODO create a commandMap per rpc instance
@@ -840,7 +840,7 @@ const create$6 = async ({
840
840
  };
841
841
  const NodeWorkerRpcClient = {
842
842
  __proto__: null,
843
- create: create$6
843
+ create: create$7
844
844
  };
845
845
 
846
846
  const rpcs = Object.create(null);
@@ -987,9 +987,10 @@ const runTest = async ({
987
987
 
988
988
  /**
989
989
  *
990
- * @param {{testSrc:string, tests:string[], headless:boolean, page: import('@playwright/test').Page, port:number, timeout:number, onResult:any, onFinalResult:any}} param0
990
+ * @param {{testSrc:string, tests:string[], filter?: string, headless:boolean, page: import('@playwright/test').Page, port:number, timeout:number, onResult:any, onFinalResult:any}} param0
991
991
  */
992
992
  const runTests = async ({
993
+ filter,
993
994
  headless,
994
995
  onFinalResult,
995
996
  onResult,
@@ -1004,7 +1005,9 @@ const runTests = async ({
1004
1005
  let skipped = 0;
1005
1006
  let passed = 0;
1006
1007
  const start = performance.now();
1007
- for (const test of tests) {
1008
+ // Filter tests if a filter is provided
1009
+ const filteredTests = filter ? tests.filter(test => test.includes(filter)) : tests;
1010
+ for (const test of filteredTests) {
1008
1011
  const result = await runTest({
1009
1012
  page,
1010
1013
  port,
@@ -1291,8 +1294,9 @@ const tearDownTests = async ({
1291
1294
  * @param {number} timeout
1292
1295
  * @param {string} serverPath
1293
1296
  * @param {boolean} traceFocus
1297
+ * @param {string} filter
1294
1298
  */
1295
- const runAllTests = async (extensionPath, testPath, cwd, headless, timeout, serverPath, traceFocus) => {
1299
+ const runAllTests = async (extensionPath, testPath, cwd, headless, timeout, serverPath, traceFocus, filter) => {
1296
1300
  string(extensionPath);
1297
1301
  string(testPath);
1298
1302
  string(cwd);
@@ -1324,6 +1328,7 @@ const runAllTests = async (extensionPath, testPath, cwd, headless, timeout, serv
1324
1328
  await rpc.invoke(HandleFinalResult, finalResult);
1325
1329
  };
1326
1330
  await runTests({
1331
+ filter,
1327
1332
  headless,
1328
1333
  onFinalResult,
1329
1334
  onResult,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/test-with-playwright-worker",
3
- "version": "13.0.0",
3
+ "version": "14.1.0",
4
4
  "description": "Worker package for test-with-playwright",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,6 +15,6 @@
15
15
  "@playwright/test": "1.58.0"
16
16
  },
17
17
  "engines": {
18
- "node": ">=22"
18
+ "node": ">=24"
19
19
  }
20
20
  }