@lvce-editor/test-worker 14.8.0 → 14.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 +2 -0
- package/dist/testWorkerMain.js +41 -23
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -234,7 +234,9 @@ interface Chat {
|
|
|
234
234
|
readonly setReasoningPickerEnabled: (enabled: boolean) => Promise<void>;
|
|
235
235
|
readonly setScrollDownButtonEnabled: (enabled: boolean) => Promise<void>;
|
|
236
236
|
readonly setSearchEnabled: (enabled: boolean) => Promise<void>;
|
|
237
|
+
readonly setShowChatListTime: (showTime: boolean) => Promise<any>;
|
|
237
238
|
readonly setStreamingEnabled: (enabled: boolean) => Promise<void>;
|
|
239
|
+
readonly shouldHaveComposerSelection: (start: number, end: number) => Promise<void>;
|
|
238
240
|
readonly show: () => Promise<void>;
|
|
239
241
|
readonly showComposerAttachmentPreviewOverlay: (attachmentId: string) => Promise<void>;
|
|
240
242
|
readonly useMockApi: () => Promise<void>;
|
package/dist/testWorkerMain.js
CHANGED
|
@@ -1882,6 +1882,12 @@ const selectIndex$7 = async index => {
|
|
|
1882
1882
|
const handleClickClose = async () => {
|
|
1883
1883
|
await invoke('Chat.handleClickClose');
|
|
1884
1884
|
};
|
|
1885
|
+
const shouldHaveComposerSelection = async (start, end) => {
|
|
1886
|
+
const selection = await invoke('Chat.getComposerSelection');
|
|
1887
|
+
if (selection.start !== start || selection.end !== end) {
|
|
1888
|
+
throw new Error(`Expected selection to be { start: ${start}, end: ${end} }, but got { start: ${selection.start}, end: ${selection.end} }`);
|
|
1889
|
+
}
|
|
1890
|
+
};
|
|
1885
1891
|
const handleClickNew = async () => {
|
|
1886
1892
|
await invoke('Chat.handleClickNew');
|
|
1887
1893
|
};
|
|
@@ -2036,6 +2042,9 @@ const setNowForTest = async now => {
|
|
|
2036
2042
|
const getAuthState = async () => {
|
|
2037
2043
|
return invoke('Chat.getAuthState');
|
|
2038
2044
|
};
|
|
2045
|
+
const setShowChatListTime = async showTime => {
|
|
2046
|
+
return invoke('Chat.setShowChatListTime', showTime);
|
|
2047
|
+
};
|
|
2039
2048
|
const handleAgentModeChange = async newAgentMode => {
|
|
2040
2049
|
return invoke('Chat.handleAgentModeChange', newAgentMode);
|
|
2041
2050
|
};
|
|
@@ -2099,7 +2108,9 @@ const Chat = {
|
|
|
2099
2108
|
setReasoningPickerEnabled,
|
|
2100
2109
|
setScrollDownButtonEnabled,
|
|
2101
2110
|
setSearchEnabled,
|
|
2111
|
+
setShowChatListTime,
|
|
2102
2112
|
setStreamingEnabled,
|
|
2113
|
+
shouldHaveComposerSelection,
|
|
2103
2114
|
show: show$7,
|
|
2104
2115
|
showComposerAttachmentPreviewOverlay,
|
|
2105
2116
|
useMockApi
|
|
@@ -4796,32 +4807,39 @@ const execute = async (href, platform, assetDir) => {
|
|
|
4796
4807
|
// 1. get script to import from renderer process (url or from html)
|
|
4797
4808
|
const scriptUrl = href;
|
|
4798
4809
|
setUrl(scriptUrl); // TODO avoid side effect
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
if (
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4810
|
+
try {
|
|
4811
|
+
// 2. import that script
|
|
4812
|
+
const module = await importTest(scriptUrl);
|
|
4813
|
+
const {
|
|
4814
|
+
mockRpc,
|
|
4815
|
+
name,
|
|
4816
|
+
skip,
|
|
4817
|
+
test
|
|
4818
|
+
} = module;
|
|
4819
|
+
if (mockRpc) {
|
|
4820
|
+
setMockRpc(mockRpc);
|
|
4821
|
+
}
|
|
4822
|
+
if (test) {
|
|
4823
|
+
if (skip) {
|
|
4824
|
+
await skipTest(name);
|
|
4825
|
+
} else {
|
|
4826
|
+
await executeTest(name, test, globals);
|
|
4827
|
+
}
|
|
4815
4828
|
}
|
|
4829
|
+
// TODO maybe setup file watcher earlier, to not miss events?
|
|
4830
|
+
} catch (error) {
|
|
4831
|
+
await printTestError(error);
|
|
4832
|
+
await invoke('TestFrameWork.showOverlay', Fail, 'red', `test failed: ${error}`);
|
|
4833
|
+
return;
|
|
4834
|
+
} finally {
|
|
4835
|
+
push({
|
|
4836
|
+
assetDir,
|
|
4837
|
+
inProgress: false,
|
|
4838
|
+
platform,
|
|
4839
|
+
url: href
|
|
4840
|
+
});
|
|
4816
4841
|
}
|
|
4817
|
-
// TODO maybe setup file watcher earlier, to not miss events?
|
|
4818
4842
|
|
|
4819
|
-
push({
|
|
4820
|
-
assetDir,
|
|
4821
|
-
inProgress: false,
|
|
4822
|
-
platform,
|
|
4823
|
-
url: href
|
|
4824
|
-
});
|
|
4825
4843
|
// TODO if file watcher was previously added, don't need to add one
|
|
4826
4844
|
try {
|
|
4827
4845
|
if (await hotReloadEnabled()) {
|