@lvce-editor/test-worker 5.1.0 → 5.3.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 +18 -9
- package/dist/testWorkerMain.js +46 -7
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ declare const readNativeFiles: () => Promise<void>;
|
|
|
19
19
|
declare const writeNativeFiles: (uris: readonly string[]) => Promise<void>;
|
|
20
20
|
declare const enableMemoryClipBoard: () => Promise<void>;
|
|
21
21
|
declare const disableMemoryClipBoard: () => Promise<void>;
|
|
22
|
-
declare const shouldHaveText: (expectedText: string) => Promise<void>;
|
|
22
|
+
declare const shouldHaveText: (expectedText: string | RegExp) => Promise<void>;
|
|
23
23
|
declare const execute: (id: string, ...args: readonly any[]) => Promise<any>;
|
|
24
24
|
declare const selectItem: (text: string) => Promise<void>;
|
|
25
25
|
declare const openIframeInspector: () => Promise<void>;
|
|
@@ -32,6 +32,7 @@ declare const reloadIconTheme: () => Promise<void>;
|
|
|
32
32
|
declare const toggleDeveloperTools: () => Promise<void>;
|
|
33
33
|
declare const showSaveFilePicker: () => Promise<void>;
|
|
34
34
|
declare const mockSaveFilePicker: (fn: () => string) => Promise<void>;
|
|
35
|
+
declare const mockConfirm: (fn: () => boolean) => Promise<void>;
|
|
35
36
|
declare const executeMock: (id: number) => string;
|
|
36
37
|
declare const setCursor: (rowIndex: number, columnIndex: number) => Promise<void>;
|
|
37
38
|
declare const openCompletion: () => Promise<void>;
|
|
@@ -92,6 +93,7 @@ declare const shouldHaveText$1: (expectedText: string) => Promise<void>;
|
|
|
92
93
|
declare const shouldHaveSelections: (expectedSelections: Uint32Array) => Promise<void>;
|
|
93
94
|
declare const selectIndex: (index: number) => Promise<void>;
|
|
94
95
|
declare const selectCurrentIndex: () => Promise<void>;
|
|
96
|
+
declare const handleWheel: (deltaMode: number, deltaY: number) => Promise<void>;
|
|
95
97
|
declare const selectIndex$1: (index: number) => Promise<void>;
|
|
96
98
|
declare const selectCurrentIndex$1: () => Promise<void>;
|
|
97
99
|
declare const openContextMenu$1: (index: number) => Promise<void>;
|
|
@@ -171,7 +173,7 @@ declare const focusLast$2: () => Promise<void>;
|
|
|
171
173
|
declare const open$1: () => Promise<void>;
|
|
172
174
|
declare const handleInput: (value: string) => Promise<void>;
|
|
173
175
|
declare const handleClick$2: (x: number, y: number) => Promise<void>;
|
|
174
|
-
declare const handleWheel: (deltaMode: number, deltaY: number) => Promise<void>;
|
|
176
|
+
declare const handleWheel$1: (deltaMode: number, deltaY: number) => Promise<void>;
|
|
175
177
|
declare const handleDoubleClick: (x: number, y: number) => Promise<void>;
|
|
176
178
|
declare const focusNext$5: () => Promise<void>;
|
|
177
179
|
declare const focusPrevious$3: () => Promise<void>;
|
|
@@ -235,6 +237,9 @@ declare const selectItem$1: (label: string) => Promise<void>;
|
|
|
235
237
|
declare const selectIndex$3: (index: number) => Promise<void>;
|
|
236
238
|
declare const selectCurrentIndex$2: () => Promise<void>;
|
|
237
239
|
declare const executeCommand: (label: string) => Promise<void>;
|
|
240
|
+
declare const clear$1: () => Promise<void>;
|
|
241
|
+
declare const collapseAll: () => Promise<void>;
|
|
242
|
+
declare const refresh$1: () => Promise<void>;
|
|
238
243
|
declare const handleClickSectionWatch: () => Promise<void>;
|
|
239
244
|
declare const addWatchExpression: (expression: string) => Promise<void>;
|
|
240
245
|
declare const handleWatchValueChange: () => Promise<void>;
|
|
@@ -256,7 +261,7 @@ declare const focusFirst$6: () => Promise<void>;
|
|
|
256
261
|
declare const focusIndex$4: (index: number) => Promise<void>;
|
|
257
262
|
declare const selectIndex$5: (index: number) => Promise<void>;
|
|
258
263
|
declare const focusNext$8: () => Promise<void>;
|
|
259
|
-
declare const handleWheel$
|
|
264
|
+
declare const handleWheel$2: (deltaMode: number, deltaY: number) => Promise<void>;
|
|
260
265
|
declare const focusNextPage: () => Promise<void>;
|
|
261
266
|
declare const focusPreviousPage: () => Promise<void>;
|
|
262
267
|
declare const focusPrevious$6: () => Promise<void>;
|
|
@@ -271,7 +276,7 @@ declare const show$3: () => Promise<void>;
|
|
|
271
276
|
declare const handleInput$2: (searchValue: string) => Promise<void>;
|
|
272
277
|
declare const usePreviousSearchValue: () => Promise<void>;
|
|
273
278
|
declare const useNextSearchValue: () => Promise<void>;
|
|
274
|
-
declare const clear$
|
|
279
|
+
declare const clear$2: (searchValue: string) => Promise<void>;
|
|
275
280
|
declare const selectTab$1: (tabId: string) => Promise<void>;
|
|
276
281
|
declare const selectWorkspace: () => Promise<void>;
|
|
277
282
|
declare const selectTextEditor: () => Promise<void>;
|
|
@@ -332,13 +337,13 @@ declare namespace Developer {
|
|
|
332
337
|
export { openCacheFolder, openConfigFolder, openIframeInspector, openLogsFolder, openProcessExplorer, reloadColorTheme, reloadIconTheme, toggleDeveloperTools };
|
|
333
338
|
}
|
|
334
339
|
declare namespace Dialog {
|
|
335
|
-
export { executeMock, mockSaveFilePicker, showSaveFilePicker };
|
|
340
|
+
export { executeMock, mockConfirm, mockSaveFilePicker, showSaveFilePicker };
|
|
336
341
|
}
|
|
337
342
|
declare namespace Editor {
|
|
338
343
|
export { addAllMissingImports, closeColorPicker, closeCompletion, closeCompletionDetails, copy, copyLineDown, copyLineUp, cursorCharacterLeft, cursorCharacterRight, cursorDown, cursorEnd, cursorHome, cursorUp, cursorWordLeft, cursorWordPartLeft, cursorWordPartRight, cursorWordRight, deleteAllLeft, deleteAllRight, executeTabCompletion, findAllImplementations, findAllReferences, format, getSelections, getText, goToDefinition, goToTypeDefinition, growSelection, insertLineBreak, invokeBraceCompletion, invokeTabCompletion, openColorPicker, openCompletion, openCompletionDetails, openContextMenu, openEditorContextMenu, openFind, openFindWidget, openHover, openRename, openSourceActions, organizeImports, rename, rename2, selectAll, setCursor, setDeltaY, setSelections, shouldHaveSelections, shouldHaveText$1 as shouldHaveText, showHover, sortImports, sourceActionsSelectCurrent, toggleBlockComment, toggleCompletionDetails, toggleLineComment, type };
|
|
339
344
|
}
|
|
340
345
|
declare namespace EditorCompletion {
|
|
341
|
-
export { selectCurrentIndex, selectIndex };
|
|
346
|
+
export { handleWheel, selectCurrentIndex, selectIndex };
|
|
342
347
|
}
|
|
343
348
|
declare namespace EditorSourceAction {
|
|
344
349
|
export { selectCurrentIndex$1 as selectCurrentIndex, selectIndex$1 as selectIndex };
|
|
@@ -365,7 +370,7 @@ declare namespace IframeInspector {
|
|
|
365
370
|
export { focusFirst$2 as focusFirst, focusLast$2 as focusLast, focusNext$4 as focusNext, focusPrevious$2 as focusPrevious, selectIndex$2 as selectIndex };
|
|
366
371
|
}
|
|
367
372
|
declare namespace KeyBindingsEditor {
|
|
368
|
-
export { addKeyBinding, changeWhenExpression, clearInput, copyCommandId, copyCommandTitle, focusFirst$3 as focusFirst, focusIndex$1 as focusIndex, focusLast$3 as focusLast, focusNext$5 as focusNext, focusPrevious$3 as focusPrevious, handleClick$2 as handleClick, handleContextMenu$1 as handleContextMenu, handleDoubleClick, handleInput, handleWheel, open$1 as open, removeKeyBinding, resetKeyBinding, showSameKeyBindings, sortByPrecedence, startRecordingKeys, stopRecordingKeys, toggleRecordingKeys };
|
|
373
|
+
export { addKeyBinding, changeWhenExpression, clearInput, copyCommandId, copyCommandTitle, focusFirst$3 as focusFirst, focusIndex$1 as focusIndex, focusLast$3 as focusLast, focusNext$5 as focusNext, focusPrevious$3 as focusPrevious, handleClick$2 as handleClick, handleContextMenu$1 as handleContextMenu, handleDoubleClick, handleInput, handleWheel$1 as handleWheel, open$1 as open, removeKeyBinding, resetKeyBinding, showSameKeyBindings, sortByPrecedence, startRecordingKeys, stopRecordingKeys, toggleRecordingKeys };
|
|
369
374
|
}
|
|
370
375
|
declare namespace KeyBoard {
|
|
371
376
|
export { press };
|
|
@@ -388,17 +393,20 @@ declare namespace Problems {
|
|
|
388
393
|
declare namespace QuickPick {
|
|
389
394
|
export { executeCommand, focusFirst$5 as focusFirst, focusIndex$3 as focusIndex, focusLast$5 as focusLast, focusNext$7 as focusNext, focusPrevious$5 as focusPrevious, handleClickAt$2 as handleClickAt, handleInput$1 as handleInput, open$3 as open, selectCurrentIndex$2 as selectCurrentIndex, selectIndex$3 as selectIndex, selectItem$1 as selectItem, setValue$1 as setValue };
|
|
390
395
|
}
|
|
396
|
+
declare namespace References {
|
|
397
|
+
export { clear$1 as clear, collapseAll, refresh$1 as refresh };
|
|
398
|
+
}
|
|
391
399
|
declare namespace RunAndDebug {
|
|
392
400
|
export { acceptWatchExpressionEdit, addWatchExpression, handleClickSectionWatch, handleRename, handleSpace, handleWatchValueChange, selectIndex$4 as selectIndex, setPauseOnExceptions };
|
|
393
401
|
}
|
|
394
402
|
declare namespace Search {
|
|
395
|
-
export { clearSearchResults, collapseDetails, dismissItem, focusFirst$6 as focusFirst, focusIndex$4 as focusIndex, focusNext$8 as focusNext, focusNextPage, focusPrevious$6 as focusPrevious, focusPreviousPage, handleWheel$
|
|
403
|
+
export { clearSearchResults, collapseDetails, dismissItem, focusFirst$6 as focusFirst, focusIndex$4 as focusIndex, focusNext$8 as focusNext, focusNextPage, focusPrevious$6 as focusPrevious, focusPreviousPage, handleWheel$2 as handleWheel, openDetails, replaceAll, selectIndex$5 as selectIndex, setExcludeValue, setIncludeValue, setReplaceValue, setValue$2 as setValue, toggleMatchCase, toggleMatchWholeWord, togglePreserveCase, toggleReplace, toggleSearchDetails, toggleUseRegularExpression };
|
|
396
404
|
}
|
|
397
405
|
declare namespace Settings {
|
|
398
406
|
export { update };
|
|
399
407
|
}
|
|
400
408
|
declare namespace SettingsView {
|
|
401
|
-
export { clear$
|
|
409
|
+
export { clear$2 as clear, handleInput$2 as handleInput, handleScroll$1 as handleScroll, selectExtensions, selectTab$1 as selectTab, selectTextEditor, selectWorkspace, show$3 as show, useNextSearchValue, usePreviousSearchValue };
|
|
402
410
|
}
|
|
403
411
|
declare namespace SideBar {
|
|
404
412
|
export { hide, open$4 as open };
|
|
@@ -446,6 +454,7 @@ export interface TestApi {
|
|
|
446
454
|
readonly Platform: typeof Platform,
|
|
447
455
|
readonly Problems: typeof Problems,
|
|
448
456
|
readonly QuickPick: typeof QuickPick,
|
|
457
|
+
readonly References: typeof References,
|
|
449
458
|
readonly RunAndDebug: typeof RunAndDebug,
|
|
450
459
|
readonly Search: typeof Search,
|
|
451
460
|
readonly Settings: typeof Settings,
|
package/dist/testWorkerMain.js
CHANGED
|
@@ -1195,10 +1195,11 @@ const getLocatorInvoke = locator => {
|
|
|
1195
1195
|
const module = get(locator.webViewId);
|
|
1196
1196
|
return module.invoke;
|
|
1197
1197
|
}
|
|
1198
|
+
// @ts-ignore
|
|
1198
1199
|
return invoke$1;
|
|
1199
1200
|
};
|
|
1200
1201
|
|
|
1201
|
-
const locatorInvoke = (locator, method, ...params) => {
|
|
1202
|
+
const locatorInvoke = async (locator, method, ...params) => {
|
|
1202
1203
|
object(locator);
|
|
1203
1204
|
string$1(method);
|
|
1204
1205
|
const invoke = getLocatorInvoke(locator);
|
|
@@ -1735,10 +1736,16 @@ const disableMemoryClipBoard = async () => {
|
|
|
1735
1736
|
// @ts-ignore
|
|
1736
1737
|
await invoke$1('ClipBoard.disableMemoryClipBoard');
|
|
1737
1738
|
};
|
|
1739
|
+
const matchesExpectedText = (actualText, expectedText) => {
|
|
1740
|
+
if (typeof expectedText === 'string') {
|
|
1741
|
+
return actualText === expectedText;
|
|
1742
|
+
}
|
|
1743
|
+
return expectedText.test(actualText);
|
|
1744
|
+
};
|
|
1738
1745
|
const shouldHaveText$1 = async expectedText => {
|
|
1739
1746
|
// @ts-ignore
|
|
1740
1747
|
const actualText = await invoke$1('ClipBoard.readMemoryText');
|
|
1741
|
-
if (actualText
|
|
1748
|
+
if (!matchesExpectedText(actualText, expectedText)) {
|
|
1742
1749
|
throw new AssertionError(`expected clipboard to have text "${expectedText}" but was "${actualText}"`);
|
|
1743
1750
|
}
|
|
1744
1751
|
};
|
|
@@ -1840,6 +1847,11 @@ const mockSaveFilePicker = async fn => {
|
|
|
1840
1847
|
// @ts-ignore
|
|
1841
1848
|
await invoke$1('FilePicker.mockSaveFilePicker', id);
|
|
1842
1849
|
};
|
|
1850
|
+
const mockConfirm = async fn => {
|
|
1851
|
+
const id = registerMock(fn);
|
|
1852
|
+
// @ts-ignore
|
|
1853
|
+
await invoke$1('ConfirmPrompt.mock', id);
|
|
1854
|
+
};
|
|
1843
1855
|
const executeMock = id => {
|
|
1844
1856
|
return executeMock$1(id);
|
|
1845
1857
|
};
|
|
@@ -1847,6 +1859,7 @@ const executeMock = id => {
|
|
|
1847
1859
|
const TestFrameWorkComponentDialog = {
|
|
1848
1860
|
__proto__: null,
|
|
1849
1861
|
executeMock,
|
|
1862
|
+
mockConfirm,
|
|
1850
1863
|
mockSaveFilePicker,
|
|
1851
1864
|
showSaveFilePicker
|
|
1852
1865
|
};
|
|
@@ -2072,7 +2085,7 @@ const getSelections = async () => {
|
|
|
2072
2085
|
return invoke('Editor.getSelections', numeric);
|
|
2073
2086
|
};
|
|
2074
2087
|
const shouldHaveText = async expectedText => {
|
|
2075
|
-
const text = await invoke
|
|
2088
|
+
const text = await invoke('Editor.getText');
|
|
2076
2089
|
if (text !== expectedText) {
|
|
2077
2090
|
throw new Error(`Expected editor to have text ${expectedText} but was ${text}`);
|
|
2078
2091
|
}
|
|
@@ -2155,9 +2168,14 @@ const selectIndex$6 = async index => {
|
|
|
2155
2168
|
const selectCurrentIndex$2 = async () => {
|
|
2156
2169
|
await invoke$1('EditorCompletion.selectCurrentIndex');
|
|
2157
2170
|
};
|
|
2171
|
+
const handleWheel$2 = async (deltaMode, deltaY) => {
|
|
2172
|
+
// @ts-ignore
|
|
2173
|
+
await invoke$1('EditorCompletion.handleWheel', deltaMode, deltaY);
|
|
2174
|
+
};
|
|
2158
2175
|
|
|
2159
2176
|
const TestFrameWorkComponentEditorCompletion = {
|
|
2160
2177
|
__proto__: null,
|
|
2178
|
+
handleWheel: handleWheel$2,
|
|
2161
2179
|
selectCurrentIndex: selectCurrentIndex$2,
|
|
2162
2180
|
selectIndex: selectIndex$6
|
|
2163
2181
|
};
|
|
@@ -2208,7 +2226,7 @@ const handleDragOverIndex = async index => {
|
|
|
2208
2226
|
const selectDown = async () => {
|
|
2209
2227
|
await invoke$1('Explorer.selectDown');
|
|
2210
2228
|
};
|
|
2211
|
-
const refresh = async () => {
|
|
2229
|
+
const refresh$1 = async () => {
|
|
2212
2230
|
await invoke$1('Explorer.refresh');
|
|
2213
2231
|
};
|
|
2214
2232
|
const focusIndex$5 = async index => {
|
|
@@ -2320,7 +2338,7 @@ const TestFrameWorkComponentExplorer = {
|
|
|
2320
2338
|
newFile,
|
|
2321
2339
|
newFolder,
|
|
2322
2340
|
openContextMenu,
|
|
2323
|
-
refresh,
|
|
2341
|
+
refresh: refresh$1,
|
|
2324
2342
|
removeDirent,
|
|
2325
2343
|
rename,
|
|
2326
2344
|
renameDirent,
|
|
@@ -2782,14 +2800,14 @@ const selectChannel = async channelId => {
|
|
|
2782
2800
|
// @ts-ignore
|
|
2783
2801
|
await invoke$1('Output.selectChannel', channelId);
|
|
2784
2802
|
};
|
|
2785
|
-
const clear$
|
|
2803
|
+
const clear$2 = async () => {
|
|
2786
2804
|
// @ts-ignore
|
|
2787
2805
|
await invoke$1('Output.clear');
|
|
2788
2806
|
};
|
|
2789
2807
|
|
|
2790
2808
|
const TestFrameWorkComponentOutput = {
|
|
2791
2809
|
__proto__: null,
|
|
2792
|
-
clear: clear$
|
|
2810
|
+
clear: clear$2,
|
|
2793
2811
|
handleFilterInput: handleFilterInput$1,
|
|
2794
2812
|
selectChannel,
|
|
2795
2813
|
show: show$2
|
|
@@ -2977,6 +2995,26 @@ const TestFrameWorkComponentQuickPick = {
|
|
|
2977
2995
|
setValue: setValue$1
|
|
2978
2996
|
};
|
|
2979
2997
|
|
|
2998
|
+
const clear$1 = async () => {
|
|
2999
|
+
// @ts-ignore
|
|
3000
|
+
return invoke$1('References.clear');
|
|
3001
|
+
};
|
|
3002
|
+
const collapseAll = async () => {
|
|
3003
|
+
// @ts-ignore
|
|
3004
|
+
return invoke$1('References.collapseAll');
|
|
3005
|
+
};
|
|
3006
|
+
const refresh = async () => {
|
|
3007
|
+
// @ts-ignore
|
|
3008
|
+
return invoke$1('References.refresh');
|
|
3009
|
+
};
|
|
3010
|
+
|
|
3011
|
+
const TestFrameWorkComponentReferences = {
|
|
3012
|
+
__proto__: null,
|
|
3013
|
+
clear: clear$1,
|
|
3014
|
+
collapseAll,
|
|
3015
|
+
refresh
|
|
3016
|
+
};
|
|
3017
|
+
|
|
2980
3018
|
const handleClickSectionWatch = async () => {
|
|
2981
3019
|
// @ts-ignore
|
|
2982
3020
|
await invoke$1('Run And Debug.handleClickSectionWatch');
|
|
@@ -3432,6 +3470,7 @@ const TestFrameWorkComponent = {
|
|
|
3432
3470
|
Platform: TestFrameWorkComponentPlatform,
|
|
3433
3471
|
Problems: TestFrameWorkComponentProblems,
|
|
3434
3472
|
QuickPick: TestFrameWorkComponentQuickPick,
|
|
3473
|
+
References: TestFrameWorkComponentReferences,
|
|
3435
3474
|
RunAndDebug: TestFrameWorkComponentRunAndDebug,
|
|
3436
3475
|
Search: TestFrameWorkComponentSearch,
|
|
3437
3476
|
Settings: TestFrameWorkComponentSettings,
|