@lvce-editor/test-worker 10.7.0 → 10.9.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/api.d.ts +20 -13
- package/dist/testWorkerMain.js +121 -87
- package/package.json +2 -2
package/dist/api.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export interface LocatorExpect {
|
|
2
|
+
readonly not: LocatorExpect;
|
|
3
|
+
readonly toBeFocused: () => Promise<void>;
|
|
4
|
+
readonly toBeHidden: () => Promise<void>;
|
|
2
5
|
readonly toBeVisible: () => Promise<void>;
|
|
3
|
-
readonly toHaveText: (text: string) => Promise<void>;
|
|
4
6
|
readonly toContainText: (text: string) => Promise<void>;
|
|
5
|
-
readonly toHaveValue: (value: string) => Promise<void>;
|
|
6
|
-
readonly toBeFocused: () => Promise<void>;
|
|
7
|
-
readonly toHaveCSS: (key: string, value: string) => Promise<void>;
|
|
8
7
|
readonly toHaveAttribute: (key: string, value: string | null) => Promise<void>;
|
|
9
|
-
readonly toHaveJSProperty: (key: string, value: any) => Promise<void>;
|
|
10
8
|
readonly toHaveClass: (className: string) => Promise<void>;
|
|
11
|
-
readonly toHaveId: (id: string) => Promise<void>;
|
|
12
9
|
readonly toHaveCount: (count: number) => Promise<void>;
|
|
13
|
-
readonly
|
|
14
|
-
readonly
|
|
10
|
+
readonly toHaveCSS: (key: string, value: string) => Promise<void>;
|
|
11
|
+
readonly toHaveId: (id: string) => Promise<void>;
|
|
12
|
+
readonly toHaveJSProperty: (key: string, value: any) => Promise<void>;
|
|
13
|
+
readonly toHaveText: (text: string) => Promise<void>;
|
|
14
|
+
readonly toHaveValue: (value: string) => Promise<void>;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
interface LocatorClickOptions {
|
|
@@ -20,12 +20,12 @@ interface LocatorClickOptions {
|
|
|
20
20
|
|
|
21
21
|
interface ILocatorExternal {
|
|
22
22
|
readonly click: (options: LocatorClickOptions) => Promise<void>;
|
|
23
|
-
readonly
|
|
23
|
+
readonly dispatchEvent: (type: string, init: string) => Promise<void>;
|
|
24
24
|
readonly first: () => ILocatorExternal;
|
|
25
|
+
readonly hover: () => Promise<void>;
|
|
25
26
|
readonly locator: (subSelector: string) => ILocatorExternal;
|
|
26
27
|
readonly nth: (nth: number) => ILocatorExternal;
|
|
27
28
|
readonly type: (text: string) => Promise<void>;
|
|
28
|
-
readonly dispatchEvent: (type: string, init: string) => Promise<void>;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
interface LocatorConstructor {
|
|
@@ -33,17 +33,17 @@ interface LocatorConstructor {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export interface Diagnostic {
|
|
36
|
-
readonly rowIndex: number;
|
|
37
36
|
readonly columnIndex: number;
|
|
38
|
-
readonly endRowIndex: number;
|
|
39
37
|
readonly endColumnIndex: number;
|
|
38
|
+
readonly endRowIndex: number;
|
|
40
39
|
readonly message: string;
|
|
40
|
+
readonly rowIndex: number;
|
|
41
41
|
readonly type: "error" | "warning";
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
export interface DroppedFileHandle {
|
|
45
|
-
readonly id: number;
|
|
46
45
|
readonly file: File;
|
|
46
|
+
readonly id: number;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
export interface FileSystemTmpDirOptions {
|
|
@@ -139,7 +139,9 @@ interface Editor {
|
|
|
139
139
|
readonly deleteAllLeft: () => Promise<void>;
|
|
140
140
|
readonly deleteAllRight: () => Promise<void>;
|
|
141
141
|
readonly disableCompletionsOnType: () => Promise<void>;
|
|
142
|
+
readonly disableDiagnostics: () => Promise<void>;
|
|
142
143
|
readonly enableCompletionsOnType: () => Promise<void>;
|
|
144
|
+
readonly enableDiagnostics: () => Promise<void>;
|
|
143
145
|
readonly executeTabCompletion: () => Promise<void>;
|
|
144
146
|
readonly findAllImplementations: () => Promise<void>;
|
|
145
147
|
readonly findAllReferences: () => Promise<void>;
|
|
@@ -255,12 +257,16 @@ interface Extension {
|
|
|
255
257
|
}
|
|
256
258
|
|
|
257
259
|
interface ExtensionDetail {
|
|
260
|
+
readonly copyReadmeLink: (href: string) => Promise<void>;
|
|
258
261
|
readonly handleClickCategory: (categoryId: string) => Promise<void>;
|
|
259
262
|
readonly handleClickDisable: () => Promise<void>;
|
|
260
263
|
readonly handleClickEnable: () => Promise<void>;
|
|
261
264
|
readonly handleClickSetColorTheme: () => Promise<void>;
|
|
265
|
+
readonly handleClickUninstall: () => Promise<void>;
|
|
266
|
+
readonly handleImageContextMenu: () => Promise<void>;
|
|
262
267
|
readonly handleReadmeContextMenu: (x: number, y: number, nodeName: string, href: string) => Promise<void>;
|
|
263
268
|
readonly handleScroll: (scrollTop: number) => Promise<void>;
|
|
269
|
+
readonly hideSizeLink: () => Promise<void>;
|
|
264
270
|
readonly open: (extensionId: string) => Promise<void>;
|
|
265
271
|
readonly openCommands: () => Promise<void>;
|
|
266
272
|
readonly openFeature: (featureName: string) => Promise<void>;
|
|
@@ -506,6 +512,7 @@ interface SideBar {
|
|
|
506
512
|
interface SourceControl {
|
|
507
513
|
readonly acceptInput: () => Promise<void>;
|
|
508
514
|
readonly handleClickSourceControlButtons: (index: number, name: string) => Promise<void>;
|
|
515
|
+
readonly handleContextMenu: (button: number, x: number, y: number) => Promise<void>;
|
|
509
516
|
readonly handleInput: (text: string) => Promise<void>;
|
|
510
517
|
readonly selectIndex: (index: number) => Promise<void>;
|
|
511
518
|
readonly show: () => Promise<void>;
|
package/dist/testWorkerMain.js
CHANGED
|
@@ -1179,8 +1179,8 @@ const toHaveValue = (locator, {
|
|
|
1179
1179
|
const toHaveText = async (locator, options) => {
|
|
1180
1180
|
const locatorString = printLocator(locator);
|
|
1181
1181
|
const {
|
|
1182
|
-
|
|
1183
|
-
|
|
1182
|
+
actual,
|
|
1183
|
+
wasFound
|
|
1184
1184
|
} = await locatorInvoke(locator, 'TestFrameWork.checkConditionError', 'toHaveText', locator, options);
|
|
1185
1185
|
const {
|
|
1186
1186
|
text
|
|
@@ -1193,8 +1193,8 @@ const toHaveText = async (locator, options) => {
|
|
|
1193
1193
|
const toContainText = async (locator, options) => {
|
|
1194
1194
|
const locatorString = printLocator(locator);
|
|
1195
1195
|
const {
|
|
1196
|
-
|
|
1197
|
-
|
|
1196
|
+
actual,
|
|
1197
|
+
wasFound
|
|
1198
1198
|
} = await locatorInvoke(locator, 'TestFrameWork.checkConditionError', 'toContainText', locator, options);
|
|
1199
1199
|
const {
|
|
1200
1200
|
text
|
|
@@ -1207,8 +1207,8 @@ const toContainText = async (locator, options) => {
|
|
|
1207
1207
|
const toHaveAttribute = async (locator, options) => {
|
|
1208
1208
|
const locatorString = printLocator(locator);
|
|
1209
1209
|
const {
|
|
1210
|
-
|
|
1211
|
-
|
|
1210
|
+
actual,
|
|
1211
|
+
wasFound
|
|
1212
1212
|
} = await locatorInvoke(locator, 'TestFrameWork.checkConditionError', 'toHaveAttribute', locator, options);
|
|
1213
1213
|
const {
|
|
1214
1214
|
key,
|
|
@@ -1250,8 +1250,8 @@ const toHaveClass = async (locator, options) => {
|
|
|
1250
1250
|
};
|
|
1251
1251
|
const toHaveId = async (locator, options) => {
|
|
1252
1252
|
const {
|
|
1253
|
-
|
|
1254
|
-
|
|
1253
|
+
actual,
|
|
1254
|
+
wasFound
|
|
1255
1255
|
} = await locatorInvoke(locator, 'TestFrameWork.checkConditionError', 'toHaveId', locator, options);
|
|
1256
1256
|
const locatorString = printLocator(locator);
|
|
1257
1257
|
const {
|
|
@@ -1268,8 +1268,8 @@ const toBeHidden = locator => {
|
|
|
1268
1268
|
};
|
|
1269
1269
|
const toHaveCss = async (locator, options) => {
|
|
1270
1270
|
const {
|
|
1271
|
-
|
|
1272
|
-
|
|
1271
|
+
actual,
|
|
1272
|
+
wasFound
|
|
1273
1273
|
} = await locatorInvoke(locator, 'TestFrameWork.checkConditionError', 'toHaveCss', locator, options);
|
|
1274
1274
|
const locatorString = printLocator(locator);
|
|
1275
1275
|
const {
|
|
@@ -1283,8 +1283,8 @@ const toHaveCss = async (locator, options) => {
|
|
|
1283
1283
|
};
|
|
1284
1284
|
const toHaveJSProperty = async (locator, options) => {
|
|
1285
1285
|
const {
|
|
1286
|
-
|
|
1287
|
-
|
|
1286
|
+
actual,
|
|
1287
|
+
wasFound
|
|
1288
1288
|
} = await locatorInvoke(locator, 'TestFrameWork.checkConditionError', 'toHaveJSProperty', locator, options);
|
|
1289
1289
|
const locatorString = printLocator(locator);
|
|
1290
1290
|
const {
|
|
@@ -1299,30 +1299,30 @@ const toHaveJSProperty = async (locator, options) => {
|
|
|
1299
1299
|
|
|
1300
1300
|
const getFunction = fnName => {
|
|
1301
1301
|
switch (fnName) {
|
|
1302
|
+
case 'toBeFocused':
|
|
1303
|
+
return toBeFocused;
|
|
1304
|
+
case 'toBeHidden':
|
|
1305
|
+
return toBeHidden;
|
|
1302
1306
|
case 'toBeVisible':
|
|
1303
1307
|
return toBeVisible;
|
|
1304
|
-
case 'toHaveValue':
|
|
1305
|
-
return toHaveValue;
|
|
1306
|
-
case 'toHaveText':
|
|
1307
|
-
return toHaveText;
|
|
1308
1308
|
case 'toContainText':
|
|
1309
1309
|
return toContainText;
|
|
1310
1310
|
case 'toHaveAttribute':
|
|
1311
1311
|
return toHaveAttribute;
|
|
1312
|
+
case 'toHaveClass':
|
|
1313
|
+
return toHaveClass;
|
|
1312
1314
|
case 'toHaveCount':
|
|
1313
1315
|
return toHaveCount;
|
|
1314
|
-
case 'toBeFocused':
|
|
1315
|
-
return toBeFocused;
|
|
1316
|
-
case 'toHaveId':
|
|
1317
|
-
return toHaveId;
|
|
1318
|
-
case 'toBeHidden':
|
|
1319
|
-
return toBeHidden;
|
|
1320
1316
|
case 'toHaveCss':
|
|
1321
1317
|
return toHaveCss;
|
|
1322
|
-
case '
|
|
1323
|
-
return
|
|
1318
|
+
case 'toHaveId':
|
|
1319
|
+
return toHaveId;
|
|
1324
1320
|
case 'toHaveJSProperty':
|
|
1325
1321
|
return toHaveJSProperty;
|
|
1322
|
+
case 'toHaveText':
|
|
1323
|
+
return toHaveText;
|
|
1324
|
+
case 'toHaveValue':
|
|
1325
|
+
return toHaveValue;
|
|
1326
1326
|
default:
|
|
1327
1327
|
throw new Error(`unexpected function name ${fnName}`);
|
|
1328
1328
|
}
|
|
@@ -1452,16 +1452,16 @@ const nameAnonymousFunction = (fn, name) => {
|
|
|
1452
1452
|
// @ts-nocheck
|
|
1453
1453
|
|
|
1454
1454
|
const state = {
|
|
1455
|
+
mockRpcs: Object.create(null),
|
|
1455
1456
|
/**
|
|
1456
1457
|
* @type {any[]}
|
|
1457
1458
|
*/
|
|
1458
|
-
pendingTests: []
|
|
1459
|
-
mockRpcs: Object.create(null)
|
|
1459
|
+
pendingTests: []
|
|
1460
1460
|
};
|
|
1461
1461
|
const addTest = (name, fn) => {
|
|
1462
1462
|
state.pendingTests.push({
|
|
1463
|
-
|
|
1464
|
-
|
|
1463
|
+
fn,
|
|
1464
|
+
name
|
|
1465
1465
|
});
|
|
1466
1466
|
};
|
|
1467
1467
|
const getTests = () => {
|
|
@@ -1497,8 +1497,8 @@ const performAction = async (locator, action, options) => {
|
|
|
1497
1497
|
};
|
|
1498
1498
|
class Locator {
|
|
1499
1499
|
constructor(selector, {
|
|
1500
|
-
|
|
1501
|
-
|
|
1500
|
+
hasText = '',
|
|
1501
|
+
nth = -1
|
|
1502
1502
|
} = {}) {
|
|
1503
1503
|
this._selector = selector;
|
|
1504
1504
|
this._nth = nth;
|
|
@@ -1508,17 +1508,17 @@ class Locator {
|
|
|
1508
1508
|
button = 'left'
|
|
1509
1509
|
} = {}) {
|
|
1510
1510
|
const options = {
|
|
1511
|
-
cancable: true,
|
|
1512
1511
|
bubbles: true,
|
|
1513
1512
|
button: toButtonNumber(button),
|
|
1513
|
+
cancable: true,
|
|
1514
1514
|
detail: 1
|
|
1515
1515
|
};
|
|
1516
1516
|
return performAction(this, 'click', options);
|
|
1517
1517
|
}
|
|
1518
1518
|
async hover() {
|
|
1519
1519
|
const options = {
|
|
1520
|
-
|
|
1521
|
-
|
|
1520
|
+
bubbles: true,
|
|
1521
|
+
cancable: true
|
|
1522
1522
|
};
|
|
1523
1523
|
return performAction(this, 'hover', options);
|
|
1524
1524
|
}
|
|
@@ -1546,8 +1546,8 @@ class Locator {
|
|
|
1546
1546
|
}
|
|
1547
1547
|
async dispatchEvent(type, init) {
|
|
1548
1548
|
return performAction(this, 'dispatchEvent', {
|
|
1549
|
-
|
|
1550
|
-
|
|
1549
|
+
init,
|
|
1550
|
+
type
|
|
1551
1551
|
});
|
|
1552
1552
|
}
|
|
1553
1553
|
}
|
|
@@ -1617,7 +1617,7 @@ const focusPrevious$7 = async () => {
|
|
|
1617
1617
|
const handleClick$2 = async index => {
|
|
1618
1618
|
await invoke$1('ActivityBar.handleClick', index);
|
|
1619
1619
|
};
|
|
1620
|
-
const handleContextMenu$
|
|
1620
|
+
const handleContextMenu$5 = async () => {
|
|
1621
1621
|
await invoke$1('ActivityBar.handleContextMenu');
|
|
1622
1622
|
};
|
|
1623
1623
|
const selectCurrent = async () => {
|
|
@@ -1632,7 +1632,7 @@ const ActivityBar = {
|
|
|
1632
1632
|
focusNext: focusNext$8,
|
|
1633
1633
|
focusPrevious: focusPrevious$7,
|
|
1634
1634
|
handleClick: handleClick$2,
|
|
1635
|
-
handleContextMenu: handleContextMenu$
|
|
1635
|
+
handleContextMenu: handleContextMenu$5,
|
|
1636
1636
|
selectCurrent
|
|
1637
1637
|
};
|
|
1638
1638
|
|
|
@@ -1843,13 +1843,13 @@ const update$1 = settings => {
|
|
|
1843
1843
|
// @ts-ignore
|
|
1844
1844
|
return invoke$1('Preferences.update', settings);
|
|
1845
1845
|
};
|
|
1846
|
-
const enableDiagnostics = () => {
|
|
1846
|
+
const enableDiagnostics$1 = () => {
|
|
1847
1847
|
// @ts-ignore
|
|
1848
1848
|
return invoke$1('Preferences.update', {
|
|
1849
1849
|
'editor.diagnostics': true
|
|
1850
1850
|
});
|
|
1851
1851
|
};
|
|
1852
|
-
const disableDiagnostics = () => {
|
|
1852
|
+
const disableDiagnostics$1 = () => {
|
|
1853
1853
|
// @ts-ignore
|
|
1854
1854
|
return invoke$1('Preferences.update', {
|
|
1855
1855
|
'editor.diagnostics': false
|
|
@@ -1858,8 +1858,8 @@ const disableDiagnostics = () => {
|
|
|
1858
1858
|
|
|
1859
1859
|
const Settings = {
|
|
1860
1860
|
__proto__: null,
|
|
1861
|
-
disableDiagnostics,
|
|
1862
|
-
enableDiagnostics,
|
|
1861
|
+
disableDiagnostics: disableDiagnostics$1,
|
|
1862
|
+
enableDiagnostics: enableDiagnostics$1,
|
|
1863
1863
|
update: update$1
|
|
1864
1864
|
};
|
|
1865
1865
|
|
|
@@ -2082,7 +2082,17 @@ const enableCompletionsOnType = async () => {
|
|
|
2082
2082
|
};
|
|
2083
2083
|
const disableCompletionsOnType = async () => {
|
|
2084
2084
|
await update$1({
|
|
2085
|
-
'editor.completionsOnType':
|
|
2085
|
+
'editor.completionsOnType': false
|
|
2086
|
+
});
|
|
2087
|
+
};
|
|
2088
|
+
const enableDiagnostics = async () => {
|
|
2089
|
+
await update$1({
|
|
2090
|
+
'editor.diagnostics': true
|
|
2091
|
+
});
|
|
2092
|
+
};
|
|
2093
|
+
const disableDiagnostics = async () => {
|
|
2094
|
+
await update$1({
|
|
2095
|
+
'editor.diagnostics': false
|
|
2086
2096
|
});
|
|
2087
2097
|
};
|
|
2088
2098
|
|
|
@@ -2108,7 +2118,9 @@ const Editor = {
|
|
|
2108
2118
|
deleteAllLeft,
|
|
2109
2119
|
deleteAllRight,
|
|
2110
2120
|
disableCompletionsOnType,
|
|
2121
|
+
disableDiagnostics,
|
|
2111
2122
|
enableCompletionsOnType,
|
|
2123
|
+
enableDiagnostics,
|
|
2112
2124
|
executeTabCompletion,
|
|
2113
2125
|
findAllImplementations,
|
|
2114
2126
|
findAllReferences,
|
|
@@ -2428,6 +2440,10 @@ const handleReadmeContextMenu = async (x, y, nodeName, href) => {
|
|
|
2428
2440
|
// @ts-ignore
|
|
2429
2441
|
await invoke$1('ExtensionDetail.handleReadmeContextMenu', x, y, nodeName, href);
|
|
2430
2442
|
};
|
|
2443
|
+
const copyReadmeLink = async href => {
|
|
2444
|
+
// @ts-ignore
|
|
2445
|
+
await invoke$1('ExtensionDetail.copyReadmeLink', href);
|
|
2446
|
+
};
|
|
2431
2447
|
const handleClickEnable = async () => {
|
|
2432
2448
|
// @ts-ignore
|
|
2433
2449
|
await invoke$1('ExtensionDetail.handleClickEnable');
|
|
@@ -2459,6 +2475,12 @@ const open$6 = extensionId => {
|
|
|
2459
2475
|
const uri = `extension-detail://${extensionId}`;
|
|
2460
2476
|
return invoke$1('Main.openUri', uri);
|
|
2461
2477
|
};
|
|
2478
|
+
const handleClickUninstall = () => {
|
|
2479
|
+
return invoke$1('ExtensionDetail.handleClickUninstall');
|
|
2480
|
+
};
|
|
2481
|
+
const handleImageContextMenu = () => {
|
|
2482
|
+
return invoke$1('ExtensionDetail.handleImageContextMenu');
|
|
2483
|
+
};
|
|
2462
2484
|
const openFeature = featureName => {
|
|
2463
2485
|
// @ts-ignore
|
|
2464
2486
|
return invoke$1('ExtensionDetail.handleFeaturesClick', featureName);
|
|
@@ -2485,15 +2507,22 @@ const handleScroll$1 = async scrollTop => {
|
|
|
2485
2507
|
// @ts-ignore
|
|
2486
2508
|
return invoke$1('ExtensionDetail.handleScroll', scrollTop);
|
|
2487
2509
|
};
|
|
2510
|
+
const hideSizeLink = async () => {
|
|
2511
|
+
return invoke$1('ExtensionDetail.hideSizeLink');
|
|
2512
|
+
};
|
|
2488
2513
|
|
|
2489
2514
|
const ExtensionDetail = {
|
|
2490
2515
|
__proto__: null,
|
|
2516
|
+
copyReadmeLink,
|
|
2491
2517
|
handleClickCategory,
|
|
2492
2518
|
handleClickDisable,
|
|
2493
2519
|
handleClickEnable,
|
|
2494
2520
|
handleClickSetColorTheme,
|
|
2521
|
+
handleClickUninstall,
|
|
2522
|
+
handleImageContextMenu,
|
|
2495
2523
|
handleReadmeContextMenu,
|
|
2496
2524
|
handleScroll: handleScroll$1,
|
|
2525
|
+
hideSizeLink,
|
|
2497
2526
|
open: open$6,
|
|
2498
2527
|
openCommands,
|
|
2499
2528
|
openFeature,
|
|
@@ -2529,7 +2558,7 @@ const handleInput$4 = async value => {
|
|
|
2529
2558
|
// @ts-ignore
|
|
2530
2559
|
await invoke$1('Extensions.handleInput', value, Script$1);
|
|
2531
2560
|
};
|
|
2532
|
-
const handleContextMenu$
|
|
2561
|
+
const handleContextMenu$4 = async (button, x, y) => {
|
|
2533
2562
|
// @ts-ignore
|
|
2534
2563
|
await invoke$1('Extensions.handleContextMenu', button, x, y);
|
|
2535
2564
|
};
|
|
@@ -2551,7 +2580,7 @@ const ExtensionSearch = {
|
|
|
2551
2580
|
clearSearchResults: clearSearchResults$1,
|
|
2552
2581
|
copyExtensionId,
|
|
2553
2582
|
copyExtensionInfo,
|
|
2554
|
-
handleContextMenu: handleContextMenu$
|
|
2583
|
+
handleContextMenu: handleContextMenu$4,
|
|
2555
2584
|
handleInput: handleInput$4,
|
|
2556
2585
|
open: open$4
|
|
2557
2586
|
};
|
|
@@ -2912,7 +2941,7 @@ const sortByPrecedence = () => {
|
|
|
2912
2941
|
const stopRecordingKeys = () => {
|
|
2913
2942
|
return invoke$1('KeyBindings.stopRecordingKeys');
|
|
2914
2943
|
};
|
|
2915
|
-
const handleContextMenu$
|
|
2944
|
+
const handleContextMenu$3 = (button, x, y) => {
|
|
2916
2945
|
return invoke$1('KeyBindings.handleContextMenu', button, x, y);
|
|
2917
2946
|
};
|
|
2918
2947
|
const copyCommandId = () => {
|
|
@@ -2950,7 +2979,7 @@ const KeyBindingsEditor = {
|
|
|
2950
2979
|
focusNext: focusNext$4,
|
|
2951
2980
|
focusPrevious: focusPrevious$4,
|
|
2952
2981
|
handleClick,
|
|
2953
|
-
handleContextMenu: handleContextMenu$
|
|
2982
|
+
handleContextMenu: handleContextMenu$3,
|
|
2954
2983
|
handleDoubleClick,
|
|
2955
2984
|
handleInput: handleInput$3,
|
|
2956
2985
|
handleWheel: handleWheel$1,
|
|
@@ -2976,38 +3005,38 @@ const getKeyOptions = rawKey => {
|
|
|
2976
3005
|
let key = '';
|
|
2977
3006
|
for (const part of parts) {
|
|
2978
3007
|
switch (part) {
|
|
3008
|
+
case Alt:
|
|
3009
|
+
altKey = true;
|
|
3010
|
+
break;
|
|
2979
3011
|
case Control:
|
|
2980
3012
|
ctrlKey = true;
|
|
2981
3013
|
break;
|
|
2982
3014
|
case Space:
|
|
2983
3015
|
key = ' ';
|
|
2984
3016
|
break;
|
|
2985
|
-
case Alt:
|
|
2986
|
-
altKey = true;
|
|
2987
|
-
break;
|
|
2988
3017
|
default:
|
|
2989
3018
|
key = part;
|
|
2990
3019
|
break;
|
|
2991
3020
|
}
|
|
2992
3021
|
}
|
|
2993
3022
|
return {
|
|
2994
|
-
|
|
3023
|
+
altKey,
|
|
2995
3024
|
ctrlKey,
|
|
2996
|
-
|
|
3025
|
+
key
|
|
2997
3026
|
};
|
|
2998
3027
|
}
|
|
2999
3028
|
return {
|
|
3000
|
-
|
|
3029
|
+
altKey: false,
|
|
3001
3030
|
ctrlKey: false,
|
|
3002
|
-
|
|
3031
|
+
key: rawKey
|
|
3003
3032
|
};
|
|
3004
3033
|
};
|
|
3005
3034
|
|
|
3006
3035
|
const press = async key => {
|
|
3007
3036
|
const keyOptions = getKeyOptions(key);
|
|
3008
3037
|
const options = {
|
|
3009
|
-
cancelable: true,
|
|
3010
3038
|
bubbles: true,
|
|
3039
|
+
cancelable: true,
|
|
3011
3040
|
...keyOptions
|
|
3012
3041
|
};
|
|
3013
3042
|
// @ts-ignore
|
|
@@ -3465,7 +3494,7 @@ const handleInputContextMenu = async (name, button, x, y) => {
|
|
|
3465
3494
|
// @ts-ignore
|
|
3466
3495
|
await invoke$1('Search.handleInputConextMenu', name, button, x, y);
|
|
3467
3496
|
};
|
|
3468
|
-
const handleContextMenu$
|
|
3497
|
+
const handleContextMenu$2 = async (button, x, y) => {
|
|
3469
3498
|
// @ts-ignore
|
|
3470
3499
|
await invoke$1('Search.handleContextMenu', name, button, x, y);
|
|
3471
3500
|
};
|
|
@@ -3484,7 +3513,7 @@ const Search = {
|
|
|
3484
3513
|
focusNextPage,
|
|
3485
3514
|
focusPrevious: focusPrevious$1,
|
|
3486
3515
|
focusPreviousPage,
|
|
3487
|
-
handleContextMenu: handleContextMenu$
|
|
3516
|
+
handleContextMenu: handleContextMenu$2,
|
|
3488
3517
|
handleInputContextMenu,
|
|
3489
3518
|
handleInputCopy,
|
|
3490
3519
|
handleInputCut,
|
|
@@ -3574,6 +3603,9 @@ const handleInput = async text => {
|
|
|
3574
3603
|
const handleClickSourceControlButtons = async (index, name) => {
|
|
3575
3604
|
await invoke$1('Source Control.handleClickSourceControlButtons', index, name);
|
|
3576
3605
|
};
|
|
3606
|
+
const handleContextMenu$1 = async (button, x, y) => {
|
|
3607
|
+
await invoke$1('Source Control.handleContextMenu', button, x, y);
|
|
3608
|
+
};
|
|
3577
3609
|
const show = async () => {
|
|
3578
3610
|
// @ts-ignore
|
|
3579
3611
|
await open$5('Source Control');
|
|
@@ -3583,6 +3615,7 @@ const SourceControl = {
|
|
|
3583
3615
|
__proto__: null,
|
|
3584
3616
|
acceptInput,
|
|
3585
3617
|
handleClickSourceControlButtons,
|
|
3618
|
+
handleContextMenu: handleContextMenu$1,
|
|
3586
3619
|
handleInput,
|
|
3587
3620
|
selectIndex,
|
|
3588
3621
|
show
|
|
@@ -3735,8 +3768,8 @@ const transferWebViewPort = async (webViewId, port) => {
|
|
|
3735
3768
|
|
|
3736
3769
|
const waitForFirstEventEvent = async port => {
|
|
3737
3770
|
const {
|
|
3738
|
-
|
|
3739
|
-
|
|
3771
|
+
promise,
|
|
3772
|
+
resolve
|
|
3740
3773
|
} = Promise.withResolvers();
|
|
3741
3774
|
port.onmessage = resolve;
|
|
3742
3775
|
const firstEvent = await promise;
|
|
@@ -3757,9 +3790,9 @@ const createPortRpc = async webViewId => {
|
|
|
3757
3790
|
throw new Error('unexpected first message');
|
|
3758
3791
|
}
|
|
3759
3792
|
const rpc = await MessagePortRpcParent.create({
|
|
3760
|
-
messagePort: port1,
|
|
3761
3793
|
commandMap: {},
|
|
3762
|
-
isMessagePortOpen: true
|
|
3794
|
+
isMessagePortOpen: true,
|
|
3795
|
+
messagePort: port1
|
|
3763
3796
|
});
|
|
3764
3797
|
return rpc;
|
|
3765
3798
|
};
|
|
@@ -3817,6 +3850,7 @@ const createApi = (platform, assetDir) => {
|
|
|
3817
3850
|
EditorHover,
|
|
3818
3851
|
EditorRename,
|
|
3819
3852
|
EditorSourceAction,
|
|
3853
|
+
expect,
|
|
3820
3854
|
Explorer,
|
|
3821
3855
|
Extension,
|
|
3822
3856
|
ExtensionDetail,
|
|
@@ -3828,10 +3862,13 @@ const createApi = (platform, assetDir) => {
|
|
|
3828
3862
|
}
|
|
3829
3863
|
},
|
|
3830
3864
|
FindWidget,
|
|
3865
|
+
getTmpDir: getTmpDir$1,
|
|
3866
|
+
// TODO maybe deprecate this or move to file system
|
|
3831
3867
|
IconTheme,
|
|
3832
3868
|
IframeInspector,
|
|
3833
3869
|
KeyBindingsEditor,
|
|
3834
3870
|
KeyBoard,
|
|
3871
|
+
Locator: create,
|
|
3835
3872
|
Main,
|
|
3836
3873
|
Output,
|
|
3837
3874
|
Panel,
|
|
@@ -3846,14 +3883,11 @@ const createApi = (platform, assetDir) => {
|
|
|
3846
3883
|
SideBar,
|
|
3847
3884
|
SourceControl,
|
|
3848
3885
|
StatusBar,
|
|
3886
|
+
test,
|
|
3849
3887
|
TitleBarMenuBar,
|
|
3850
3888
|
Url,
|
|
3851
3889
|
WebView,
|
|
3852
|
-
Workspace
|
|
3853
|
-
test,
|
|
3854
|
-
Locator: create,
|
|
3855
|
-
expect,
|
|
3856
|
-
getTmpDir: getTmpDir$1 // TODO maybe deprecate this or move to file system
|
|
3890
|
+
Workspace
|
|
3857
3891
|
};
|
|
3858
3892
|
};
|
|
3859
3893
|
|
|
@@ -3882,27 +3916,27 @@ const executeTest2 = async (name, fn, globals, timestampGenerator) => {
|
|
|
3882
3916
|
const formattedDuration = formatDuration(duration);
|
|
3883
3917
|
if (error) {
|
|
3884
3918
|
return {
|
|
3885
|
-
|
|
3886
|
-
start,
|
|
3887
|
-
end,
|
|
3919
|
+
background: 'red',
|
|
3888
3920
|
duration,
|
|
3921
|
+
end,
|
|
3922
|
+
error,
|
|
3889
3923
|
formattedDuration,
|
|
3890
3924
|
name,
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3925
|
+
start,
|
|
3926
|
+
text: `test failed: ${error}`,
|
|
3927
|
+
type: Fail
|
|
3894
3928
|
};
|
|
3895
3929
|
}
|
|
3896
3930
|
return {
|
|
3897
|
-
|
|
3898
|
-
start,
|
|
3899
|
-
end,
|
|
3931
|
+
background: 'green',
|
|
3900
3932
|
duration,
|
|
3933
|
+
end,
|
|
3934
|
+
error: undefined,
|
|
3901
3935
|
formattedDuration,
|
|
3902
3936
|
name,
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3937
|
+
start,
|
|
3938
|
+
text: `test passed in ${formattedDuration}`,
|
|
3939
|
+
type: Pass
|
|
3906
3940
|
};
|
|
3907
3941
|
};
|
|
3908
3942
|
|
|
@@ -3925,9 +3959,9 @@ const now = () => {
|
|
|
3925
3959
|
|
|
3926
3960
|
const executeTest = async (name, fn, globals = {}) => {
|
|
3927
3961
|
const {
|
|
3962
|
+
background,
|
|
3928
3963
|
error,
|
|
3929
3964
|
formattedDuration,
|
|
3930
|
-
background,
|
|
3931
3965
|
text,
|
|
3932
3966
|
type
|
|
3933
3967
|
} = await executeTest2(name, fn, globals, now);
|
|
@@ -4005,10 +4039,10 @@ const watchForHotReload = async (platform, href) => {
|
|
|
4005
4039
|
// 3. print out results
|
|
4006
4040
|
const execute = async (href, platform, assetDir) => {
|
|
4007
4041
|
push({
|
|
4008
|
-
url: href,
|
|
4009
4042
|
assetDir,
|
|
4043
|
+
inProgress: true,
|
|
4010
4044
|
platform,
|
|
4011
|
-
|
|
4045
|
+
url: href
|
|
4012
4046
|
});
|
|
4013
4047
|
const globals = createApi(platform, assetDir);
|
|
4014
4048
|
// TODO
|
|
@@ -4043,10 +4077,10 @@ const execute = async (href, platform, assetDir) => {
|
|
|
4043
4077
|
// TODO maybe setup file watcher earlier, to not miss events?
|
|
4044
4078
|
|
|
4045
4079
|
push({
|
|
4046
|
-
url: href,
|
|
4047
4080
|
assetDir,
|
|
4081
|
+
inProgress: false,
|
|
4048
4082
|
platform,
|
|
4049
|
-
|
|
4083
|
+
url: href
|
|
4050
4084
|
});
|
|
4051
4085
|
// TODO if file watcher was previously added, don't need to add one
|
|
4052
4086
|
try {
|
|
@@ -4064,10 +4098,10 @@ const hotReloadTest = async () => {
|
|
|
4064
4098
|
}
|
|
4065
4099
|
const last$1 = last();
|
|
4066
4100
|
const {
|
|
4067
|
-
platform,
|
|
4068
|
-
url,
|
|
4069
4101
|
assetDir,
|
|
4070
|
-
inProgress
|
|
4102
|
+
inProgress,
|
|
4103
|
+
platform,
|
|
4104
|
+
url
|
|
4071
4105
|
} = last$1;
|
|
4072
4106
|
if (inProgress) {
|
|
4073
4107
|
return;
|
|
@@ -4082,9 +4116,9 @@ const handleFileWatcherEvent = async event => {
|
|
|
4082
4116
|
};
|
|
4083
4117
|
|
|
4084
4118
|
const commandMap = {
|
|
4119
|
+
'FileWatcher.handleEvent': handleFileWatcherEvent,
|
|
4085
4120
|
'Test.execute': execute,
|
|
4086
|
-
'Test.executeMock': executeMock
|
|
4087
|
-
'FileWatcher.handleEvent': handleFileWatcherEvent
|
|
4121
|
+
'Test.executeMock': executeMock
|
|
4088
4122
|
};
|
|
4089
4123
|
|
|
4090
4124
|
const send = async port => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/test-worker",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.9.0",
|
|
4
4
|
"description": "Test Worker",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"type": "module",
|
|
12
12
|
"main": "dist/testWorkerMain.js",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@lvce-editor/constants": "^1.
|
|
14
|
+
"@lvce-editor/constants": "^1.41.0"
|
|
15
15
|
},
|
|
16
16
|
"types": "dist/api.d.ts"
|
|
17
17
|
}
|