@lvce-editor/test-worker 4.22.0 → 4.24.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 +14 -4
- package/dist/testWorkerMain.js +77 -21
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -184,6 +184,12 @@ declare const selectItem$1: (label: string) => Promise<void>;
|
|
|
184
184
|
declare const selectIndex$2: (index: number) => Promise<void>;
|
|
185
185
|
declare const selectCurrentIndex$1: () => Promise<void>;
|
|
186
186
|
declare const executeCommand: (label: string) => Promise<void>;
|
|
187
|
+
declare const handleClickSectionWatch: () => Promise<void>;
|
|
188
|
+
declare const addWatchExpression: (expression: string) => Promise<void>;
|
|
189
|
+
declare const handleWatchValueChange: () => Promise<void>;
|
|
190
|
+
declare const acceptWatchExpressionEdit: () => Promise<void>;
|
|
191
|
+
declare const selectIndex$3: (index: number) => Promise<void>;
|
|
192
|
+
declare const handleRename: () => Promise<void>;
|
|
187
193
|
declare const setValue$2: (value: string) => Promise<void>;
|
|
188
194
|
declare const setReplaceValue: (value: string) => Promise<void>;
|
|
189
195
|
declare const setExcludeValue: (value: string) => Promise<void>;
|
|
@@ -195,7 +201,7 @@ declare const collapseDetails: () => Promise<void>;
|
|
|
195
201
|
declare const dismissItem: () => Promise<void>;
|
|
196
202
|
declare const focusFirst$6: () => Promise<void>;
|
|
197
203
|
declare const focusIndex$2: (index: number) => Promise<void>;
|
|
198
|
-
declare const selectIndex$
|
|
204
|
+
declare const selectIndex$4: (index: number) => Promise<void>;
|
|
199
205
|
declare const focusNext$8: () => Promise<void>;
|
|
200
206
|
declare const handleWheel$1: (deltaMode: number, deltaY: number) => Promise<void>;
|
|
201
207
|
declare const focusNextPage: () => Promise<void>;
|
|
@@ -210,7 +216,7 @@ declare const toggleReplace: () => Promise<void>;
|
|
|
210
216
|
declare const update: (settings: any) => Promise<void>;
|
|
211
217
|
declare const open$4: (id: string) => Promise<void>;
|
|
212
218
|
declare const hide: () => Promise<void>;
|
|
213
|
-
declare const selectIndex$
|
|
219
|
+
declare const selectIndex$5: (index: number) => Promise<void>;
|
|
214
220
|
declare const acceptInput: () => Promise<void>;
|
|
215
221
|
declare const handleInput$2: (text: string) => Promise<void>;
|
|
216
222
|
declare const handleClickSourceControlButtons: (index: number, name: string) => Promise<void>;
|
|
@@ -304,8 +310,11 @@ declare namespace Problems {
|
|
|
304
310
|
declare namespace QuickPick {
|
|
305
311
|
export { executeCommand, focusFirst$5 as focusFirst, focusIndex$1 as focusIndex, focusLast$5 as focusLast, focusNext$7 as focusNext, focusPrevious$5 as focusPrevious, handleClickAt$1 as handleClickAt, handleInput$1 as handleInput, open$3 as open, selectCurrentIndex$1 as selectCurrentIndex, selectIndex$2 as selectIndex, selectItem$1 as selectItem, setValue$1 as setValue };
|
|
306
312
|
}
|
|
313
|
+
declare namespace RunAndDebug {
|
|
314
|
+
export { acceptWatchExpressionEdit, addWatchExpression, handleClickSectionWatch, handleRename, handleWatchValueChange, selectIndex$3 as selectIndex };
|
|
315
|
+
}
|
|
307
316
|
declare namespace Search {
|
|
308
|
-
export { clearSearchResults, collapseDetails, dismissItem, focusFirst$6 as focusFirst, focusIndex$2 as focusIndex, focusNext$8 as focusNext, focusNextPage, focusPrevious$6 as focusPrevious, focusPreviousPage, handleWheel$1 as handleWheel, openDetails, replaceAll, selectIndex$
|
|
317
|
+
export { clearSearchResults, collapseDetails, dismissItem, focusFirst$6 as focusFirst, focusIndex$2 as focusIndex, focusNext$8 as focusNext, focusNextPage, focusPrevious$6 as focusPrevious, focusPreviousPage, handleWheel$1 as handleWheel, openDetails, replaceAll, selectIndex$4 as selectIndex, setExcludeValue, setIncludeValue, setReplaceValue, setValue$2 as setValue, toggleMatchCase, toggleMatchWholeWord, togglePreserveCase, toggleReplace, toggleSearchDetails, toggleUseRegularExpression };
|
|
309
318
|
}
|
|
310
319
|
declare namespace Settings {
|
|
311
320
|
export { update };
|
|
@@ -314,7 +323,7 @@ declare namespace SideBar {
|
|
|
314
323
|
export { hide, open$4 as open };
|
|
315
324
|
}
|
|
316
325
|
declare namespace SourceControl {
|
|
317
|
-
export { acceptInput, handleClickSourceControlButtons, handleInput$2 as handleInput, selectIndex$
|
|
326
|
+
export { acceptInput, handleClickSourceControlButtons, handleInput$2 as handleInput, selectIndex$5 as selectIndex };
|
|
318
327
|
}
|
|
319
328
|
declare namespace StatusBar {
|
|
320
329
|
export { update$1 as update };
|
|
@@ -349,6 +358,7 @@ export interface TestApi {
|
|
|
349
358
|
readonly Platform: typeof Platform,
|
|
350
359
|
readonly Problems: typeof Problems,
|
|
351
360
|
readonly QuickPick: typeof QuickPick,
|
|
361
|
+
readonly RunAndDebug: typeof RunAndDebug,
|
|
352
362
|
readonly Search: typeof Search,
|
|
353
363
|
readonly Settings: typeof Settings,
|
|
354
364
|
readonly SideBar: typeof SideBar,
|
package/dist/testWorkerMain.js
CHANGED
|
@@ -746,18 +746,18 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
746
746
|
}
|
|
747
747
|
};
|
|
748
748
|
};
|
|
749
|
-
const create$1$1 = (
|
|
749
|
+
const create$1$1 = (id, error) => {
|
|
750
750
|
return {
|
|
751
751
|
jsonrpc: Two,
|
|
752
|
-
id
|
|
752
|
+
id,
|
|
753
753
|
error
|
|
754
754
|
};
|
|
755
755
|
};
|
|
756
|
-
const getErrorResponse = (
|
|
756
|
+
const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
757
757
|
const prettyError = preparePrettyError(error);
|
|
758
758
|
logError(error, prettyError);
|
|
759
759
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
760
|
-
return create$1$1(
|
|
760
|
+
return create$1$1(id, errorProperty);
|
|
761
761
|
};
|
|
762
762
|
const create$5 = (message, result) => {
|
|
763
763
|
return {
|
|
@@ -770,12 +770,27 @@ const getSuccessResponse = (message, result) => {
|
|
|
770
770
|
const resultProperty = result ?? null;
|
|
771
771
|
return create$5(message, resultProperty);
|
|
772
772
|
};
|
|
773
|
+
const getErrorResponseSimple = (id, error) => {
|
|
774
|
+
return {
|
|
775
|
+
jsonrpc: Two,
|
|
776
|
+
id,
|
|
777
|
+
error: {
|
|
778
|
+
code: Custom,
|
|
779
|
+
// @ts-ignore
|
|
780
|
+
message: error.message,
|
|
781
|
+
data: error
|
|
782
|
+
}
|
|
783
|
+
};
|
|
784
|
+
};
|
|
773
785
|
const getResponse = async (message, ipc, execute, preparePrettyError, logError, requiresSocket) => {
|
|
774
786
|
try {
|
|
775
787
|
const result = requiresSocket(message.method) ? await execute(message.method, ipc, ...message.params) : await execute(message.method, ...message.params);
|
|
776
788
|
return getSuccessResponse(message, result);
|
|
777
789
|
} catch (error) {
|
|
778
|
-
|
|
790
|
+
if (ipc.canUseSimpleErrorResponse) {
|
|
791
|
+
return getErrorResponseSimple(message.id, error);
|
|
792
|
+
}
|
|
793
|
+
return getErrorResponse(message.id, error, preparePrettyError, logError);
|
|
779
794
|
}
|
|
780
795
|
};
|
|
781
796
|
const defaultPreparePrettyError = error => {
|
|
@@ -830,7 +845,7 @@ const handleJsonRpcMessage = async (...args) => {
|
|
|
830
845
|
try {
|
|
831
846
|
ipc.send(response);
|
|
832
847
|
} catch (error) {
|
|
833
|
-
const errorResponse = getErrorResponse(message, error, preparePrettyError, logError);
|
|
848
|
+
const errorResponse = getErrorResponse(message.id, error, preparePrettyError, logError);
|
|
834
849
|
ipc.send(errorResponse);
|
|
835
850
|
}
|
|
836
851
|
return;
|
|
@@ -988,7 +1003,7 @@ const printTestError = async error => {
|
|
|
988
1003
|
};
|
|
989
1004
|
|
|
990
1005
|
const rpcs = Object.create(null);
|
|
991
|
-
const set$
|
|
1006
|
+
const set$f = (id, rpc) => {
|
|
992
1007
|
rpcs[id] = rpc;
|
|
993
1008
|
};
|
|
994
1009
|
const get$1 = id => {
|
|
@@ -1012,21 +1027,24 @@ const create$1 = rpcId => {
|
|
|
1012
1027
|
return rpc.invokeAndTransfer(method, ...params);
|
|
1013
1028
|
},
|
|
1014
1029
|
set(rpc) {
|
|
1015
|
-
set$
|
|
1030
|
+
set$f(rpcId, rpc);
|
|
1031
|
+
},
|
|
1032
|
+
async dispose() {
|
|
1033
|
+
const rpc = get$1(rpcId);
|
|
1034
|
+
await rpc.dispose();
|
|
1016
1035
|
}
|
|
1017
1036
|
};
|
|
1018
1037
|
};
|
|
1019
1038
|
const RendererWorker$1 = 1;
|
|
1020
1039
|
const {
|
|
1021
|
-
invoke: invoke$
|
|
1022
|
-
invokeAndTransfer: invokeAndTransfer$
|
|
1023
|
-
set: set$
|
|
1024
|
-
} = create$1(RendererWorker$1);
|
|
1040
|
+
invoke: invoke$3,
|
|
1041
|
+
invokeAndTransfer: invokeAndTransfer$3,
|
|
1042
|
+
set: set$3} = create$1(RendererWorker$1);
|
|
1025
1043
|
const RendererWorker = {
|
|
1026
1044
|
__proto__: null,
|
|
1027
|
-
invoke: invoke$
|
|
1028
|
-
invokeAndTransfer: invokeAndTransfer$
|
|
1029
|
-
set: set$
|
|
1045
|
+
invoke: invoke$3,
|
|
1046
|
+
invokeAndTransfer: invokeAndTransfer$3,
|
|
1047
|
+
set: set$3
|
|
1030
1048
|
};
|
|
1031
1049
|
|
|
1032
1050
|
const {
|
|
@@ -1071,6 +1089,7 @@ const executeTest = async (name, fn, globals = {}) => {
|
|
|
1071
1089
|
_end = now();
|
|
1072
1090
|
_duration = _end - _start;
|
|
1073
1091
|
_formattedDuration = formatDuration(_duration);
|
|
1092
|
+
// eslint-disable-next-line no-console
|
|
1074
1093
|
console.info(`PASS ${name} in ${_formattedDuration}`);
|
|
1075
1094
|
} catch (error) {
|
|
1076
1095
|
if (error &&
|
|
@@ -1932,7 +1951,7 @@ const TestFrameWorkComponentEditor = {
|
|
|
1932
1951
|
type
|
|
1933
1952
|
};
|
|
1934
1953
|
|
|
1935
|
-
const selectIndex$
|
|
1954
|
+
const selectIndex$5 = async index => {
|
|
1936
1955
|
await invoke('EditorCompletion.selectIndex', index);
|
|
1937
1956
|
};
|
|
1938
1957
|
const selectCurrentIndex$1 = async () => {
|
|
@@ -1942,9 +1961,10 @@ const selectCurrentIndex$1 = async () => {
|
|
|
1942
1961
|
const TestFrameWorkComponentEditorCompletion = {
|
|
1943
1962
|
__proto__: null,
|
|
1944
1963
|
selectCurrentIndex: selectCurrentIndex$1,
|
|
1945
|
-
selectIndex: selectIndex$
|
|
1964
|
+
selectIndex: selectIndex$5
|
|
1946
1965
|
};
|
|
1947
1966
|
|
|
1967
|
+
/* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
|
|
1948
1968
|
const openContextMenu = async index => {
|
|
1949
1969
|
// @ts-ignore
|
|
1950
1970
|
await invoke('Explorer.handleContextMenuKeyboard', index);
|
|
@@ -2202,7 +2222,7 @@ const TestFrameWorkComponentIconTheme = {
|
|
|
2202
2222
|
setIconTheme
|
|
2203
2223
|
};
|
|
2204
2224
|
|
|
2205
|
-
const selectIndex$
|
|
2225
|
+
const selectIndex$4 = async index => {
|
|
2206
2226
|
return invoke('IframeInspector.selectIndex', index);
|
|
2207
2227
|
};
|
|
2208
2228
|
const focusNext$5 = async () => {
|
|
@@ -2224,7 +2244,7 @@ const TestFrameWorkComponentIframeInspector = {
|
|
|
2224
2244
|
focusLast: focusLast$4,
|
|
2225
2245
|
focusNext: focusNext$5,
|
|
2226
2246
|
focusPrevious: focusPrevious$5,
|
|
2227
|
-
selectIndex: selectIndex$
|
|
2247
|
+
selectIndex: selectIndex$4
|
|
2228
2248
|
};
|
|
2229
2249
|
|
|
2230
2250
|
const open$3 = async () => {
|
|
@@ -2525,7 +2545,7 @@ const selectItem = async label => {
|
|
|
2525
2545
|
// @ts-ignore
|
|
2526
2546
|
await invoke('QuickPick.selectItem', label);
|
|
2527
2547
|
};
|
|
2528
|
-
const selectIndex$
|
|
2548
|
+
const selectIndex$3 = async index => {
|
|
2529
2549
|
// @ts-ignore
|
|
2530
2550
|
await invoke('QuickPick.selectIndex', index);
|
|
2531
2551
|
};
|
|
@@ -2554,11 +2574,46 @@ const TestFrameWorkComponentQuickPick = {
|
|
|
2554
2574
|
handleInput: handleInput$1,
|
|
2555
2575
|
open: open$1,
|
|
2556
2576
|
selectCurrentIndex,
|
|
2557
|
-
selectIndex: selectIndex$
|
|
2577
|
+
selectIndex: selectIndex$3,
|
|
2558
2578
|
selectItem,
|
|
2559
2579
|
setValue: setValue$1
|
|
2560
2580
|
};
|
|
2561
2581
|
|
|
2582
|
+
const handleClickSectionWatch = async () => {
|
|
2583
|
+
// @ts-ignore
|
|
2584
|
+
await invoke('Run And Debug.handleClickSectionWatch');
|
|
2585
|
+
};
|
|
2586
|
+
const addWatchExpression = async expression => {
|
|
2587
|
+
// @ts-ignore
|
|
2588
|
+
await invoke('Run And Debug.addWatchExpression', expression);
|
|
2589
|
+
};
|
|
2590
|
+
const handleWatchValueChange = async () => {
|
|
2591
|
+
// @ts-ignore
|
|
2592
|
+
await invoke('Run And Debug.handleWatchValueChange');
|
|
2593
|
+
};
|
|
2594
|
+
const acceptWatchExpressionEdit = async () => {
|
|
2595
|
+
// @ts-ignore
|
|
2596
|
+
await invoke('Run And Debug.acceptWatchExpressionEdit');
|
|
2597
|
+
};
|
|
2598
|
+
const selectIndex$2 = async index => {
|
|
2599
|
+
// @ts-ignore
|
|
2600
|
+
await invoke('Run And Debug.selectIndex', index);
|
|
2601
|
+
};
|
|
2602
|
+
const handleRename = async () => {
|
|
2603
|
+
// @ts-ignore
|
|
2604
|
+
await invoke('Run And Debug.handleRename');
|
|
2605
|
+
};
|
|
2606
|
+
|
|
2607
|
+
const TestFrameWorkComponentRunAndDebug = {
|
|
2608
|
+
__proto__: null,
|
|
2609
|
+
acceptWatchExpressionEdit,
|
|
2610
|
+
addWatchExpression,
|
|
2611
|
+
handleClickSectionWatch,
|
|
2612
|
+
handleRename,
|
|
2613
|
+
handleWatchValueChange,
|
|
2614
|
+
selectIndex: selectIndex$2
|
|
2615
|
+
};
|
|
2616
|
+
|
|
2562
2617
|
const Script = 2;
|
|
2563
2618
|
|
|
2564
2619
|
const setValue = async value => {
|
|
@@ -2895,6 +2950,7 @@ const TestFrameWorkComponent = {
|
|
|
2895
2950
|
Platform: TestFrameWorkComponentPlatform,
|
|
2896
2951
|
Problems: TestFrameWorkComponentProblems,
|
|
2897
2952
|
QuickPick: TestFrameWorkComponentQuickPick,
|
|
2953
|
+
RunAndDebug: TestFrameWorkComponentRunAndDebug,
|
|
2898
2954
|
Search: TestFrameWorkComponentSearch,
|
|
2899
2955
|
Settings: TestFrameWorkComponentSettings,
|
|
2900
2956
|
SideBar: TestFrameWorkComponentSideBar,
|