@lvce-editor/test-with-playwright 22.13.0 → 22.14.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.
- package/dist/main.js +27 -10
- package/package.json +5 -2
package/dist/main.js
CHANGED
|
@@ -619,7 +619,7 @@ const resolveServerEntryPoint = cwd => {
|
|
|
619
619
|
};
|
|
620
620
|
const getPossibleServerPaths = (cwd, serverPath) => {
|
|
621
621
|
const resolvedServerEntryPoint = resolveServerEntryPoint(cwd);
|
|
622
|
-
return [...(serverPath ? [resolve$1(cwd, serverPath)] : []), ...(resolvedServerEntryPoint ? [resolvedServerEntryPoint] : []), join(cwd, 'node_modules', '@lvce-editor', 'server', 'package.json'), join(cwd, '..', 'server', 'node_modules', '@lvce-editor', 'server', 'package.json'), join(cwd, '..', 'build', 'node_modules', '@lvce-editor', 'server', 'package.json')];
|
|
622
|
+
return [...(serverPath ? [resolve$1(cwd, serverPath)] : []), ...(resolvedServerEntryPoint ? [resolvedServerEntryPoint] : []), join(cwd, 'node_modules', '@lvce-editor', 'server', 'package.json'), join(cwd, '..', '..', 'node_modules', '@lvce-editor', 'server', 'package.json'), join(cwd, '..', 'server', 'node_modules', '@lvce-editor', 'server', 'package.json'), join(cwd, '..', 'build', 'node_modules', '@lvce-editor', 'server', 'package.json')];
|
|
623
623
|
};
|
|
624
624
|
const getElectronVersion = async ({
|
|
625
625
|
cwd,
|
|
@@ -1532,7 +1532,10 @@ const constructError = (message, type, name) => {
|
|
|
1532
1532
|
if (ErrorConstructor === Error) {
|
|
1533
1533
|
const error = new Error(message);
|
|
1534
1534
|
if (name && name !== 'VError') {
|
|
1535
|
-
error
|
|
1535
|
+
Object.defineProperty(error, 'name', {
|
|
1536
|
+
configurable: true,
|
|
1537
|
+
value: name
|
|
1538
|
+
});
|
|
1536
1539
|
}
|
|
1537
1540
|
return error;
|
|
1538
1541
|
}
|
|
@@ -1563,31 +1566,45 @@ const getParentStack = error => {
|
|
|
1563
1566
|
};
|
|
1564
1567
|
const MethodNotFound = -32601;
|
|
1565
1568
|
const Custom = -32001;
|
|
1569
|
+
const setStack = (error, stack) => {
|
|
1570
|
+
const descriptor = Object.getOwnPropertyDescriptor(error, 'stack');
|
|
1571
|
+
if (descriptor) {
|
|
1572
|
+
if (!descriptor.configurable && !descriptor.writable) {
|
|
1573
|
+
return;
|
|
1574
|
+
}
|
|
1575
|
+
if (!descriptor.configurable && descriptor.writable) {
|
|
1576
|
+
error.stack = stack;
|
|
1577
|
+
return;
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
Object.defineProperty(error, 'stack', {
|
|
1581
|
+
configurable: true,
|
|
1582
|
+
value: stack,
|
|
1583
|
+
writable: true
|
|
1584
|
+
});
|
|
1585
|
+
};
|
|
1566
1586
|
const restoreExistingError = (error, currentStack) => {
|
|
1567
1587
|
if (typeof error.stack === 'string') {
|
|
1568
|
-
error
|
|
1588
|
+
setStack(error, `${error.stack}${NewLine}${currentStack}`);
|
|
1569
1589
|
}
|
|
1570
1590
|
return error;
|
|
1571
1591
|
};
|
|
1572
1592
|
const restoreMethodNotFoundError = (error, currentStack) => {
|
|
1573
1593
|
const restoredError = new JsonRpcError(error.message);
|
|
1574
1594
|
const parentStack = getParentStack(error);
|
|
1575
|
-
restoredError
|
|
1595
|
+
setStack(restoredError, `${parentStack}${NewLine}${currentStack}`);
|
|
1576
1596
|
return restoredError;
|
|
1577
1597
|
};
|
|
1578
1598
|
const restoreStackFromData = (restoredError, error, currentStack) => {
|
|
1579
1599
|
if (error.data.stack && error.data.type && error.message) {
|
|
1580
|
-
restoredError
|
|
1600
|
+
setStack(restoredError, `${error.data.type}: ${error.message}${NewLine}${error.data.stack}${NewLine}${currentStack}`);
|
|
1581
1601
|
return;
|
|
1582
1602
|
}
|
|
1583
1603
|
if (error.data.stack) {
|
|
1584
|
-
restoredError
|
|
1604
|
+
setStack(restoredError, error.data.stack);
|
|
1585
1605
|
}
|
|
1586
1606
|
};
|
|
1587
1607
|
const applyDataProperties = (restoredError, error) => {
|
|
1588
|
-
if (!error.data) {
|
|
1589
|
-
return;
|
|
1590
|
-
}
|
|
1591
1608
|
restoreStackFromData(restoredError, error, getCurrentStack());
|
|
1592
1609
|
if (error.data.codeFrame) {
|
|
1593
1610
|
// @ts-ignore
|
|
@@ -1608,7 +1625,7 @@ const applyDirectProperties = (restoredError, error) => {
|
|
|
1608
1625
|
const indexNewLine = getNewLineIndex(lowerStack);
|
|
1609
1626
|
const parentStack = getParentStack(error);
|
|
1610
1627
|
// @ts-ignore
|
|
1611
|
-
restoredError
|
|
1628
|
+
setStack(restoredError, `${parentStack}${lowerStack.slice(indexNewLine)}`);
|
|
1612
1629
|
}
|
|
1613
1630
|
if (error.codeFrame) {
|
|
1614
1631
|
// @ts-ignore
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/test-with-playwright",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.14.0",
|
|
4
4
|
"description": "CLI tool for running Playwright tests",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,9 +12,12 @@
|
|
|
12
12
|
"main": "dist/main.js",
|
|
13
13
|
"bin": "bin/test-with-playwright.js",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@lvce-editor/test-with-playwright-worker": "22.
|
|
15
|
+
"@lvce-editor/test-with-playwright-worker": "22.14.0",
|
|
16
16
|
"@lvce-editor/test-worker": "^17.8.0"
|
|
17
17
|
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/minimist": "^1.2.5"
|
|
20
|
+
},
|
|
18
21
|
"engines": {
|
|
19
22
|
"node": ">=24"
|
|
20
23
|
},
|