@lvce-editor/test-worker 13.16.0 → 13.17.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 +6 -0
- package/dist/testWorkerMain.js +21 -7
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -58,6 +58,10 @@ export interface DroppedFileHandle {
|
|
|
58
58
|
readonly id: number;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
export interface MockResponseOptions {
|
|
62
|
+
readonly text: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
61
65
|
export interface MockOpenAiResponseOptions {
|
|
62
66
|
readonly status: number;
|
|
63
67
|
readonly value: any;
|
|
@@ -145,6 +149,7 @@ interface Chat {
|
|
|
145
149
|
readonly handleClickNew: () => Promise<void>;
|
|
146
150
|
readonly handleClickSessionDebug: () => Promise<void>;
|
|
147
151
|
readonly handleClickSettings: () => Promise<void>;
|
|
152
|
+
readonly handleContextMenuChatImageAttachment: (id: string, x: number, y: number) => Promise<void>;
|
|
148
153
|
readonly handleDropFiles: (file: DroppedFileHandle) => Promise<void>;
|
|
149
154
|
readonly handleInput: (text: string) => Promise<void>;
|
|
150
155
|
readonly handleInputCopy: () => Promise<void>;
|
|
@@ -167,6 +172,7 @@ interface Chat {
|
|
|
167
172
|
readonly openGitBranchPicker: () => Promise<void>;
|
|
168
173
|
readonly openMockSession: (sessionId: string, messages: readonly any[]) => Promise<void>;
|
|
169
174
|
readonly openModelPicker: () => Promise<void>;
|
|
175
|
+
readonly registerMockResponse: (options: MockResponseOptions) => Promise<void>;
|
|
170
176
|
readonly rerender: () => Promise<void>;
|
|
171
177
|
readonly reset: () => Promise<void>;
|
|
172
178
|
readonly selectIndex: (index: number) => Promise<void>;
|
package/dist/testWorkerMain.js
CHANGED
|
@@ -1812,6 +1812,9 @@ const mockOpenApiStreamPushChunk = async chunk => {
|
|
|
1812
1812
|
const openMockSession = async (sessionId, messages) => {
|
|
1813
1813
|
await invoke$1('Chat.openMockSession', sessionId, messages);
|
|
1814
1814
|
};
|
|
1815
|
+
const registerMockResponse = async options => {
|
|
1816
|
+
await invoke$1('Chat.registerMockResponse', options);
|
|
1817
|
+
};
|
|
1815
1818
|
const handleSubmit = async () => {
|
|
1816
1819
|
await invoke$1('Chat.handleSubmit');
|
|
1817
1820
|
};
|
|
@@ -1854,6 +1857,9 @@ const openModelPicker = async () => {
|
|
|
1854
1857
|
const handleClickDelete = async () => {
|
|
1855
1858
|
await invoke$1('Chat.handleClickDelete');
|
|
1856
1859
|
};
|
|
1860
|
+
const handleContextMenuChatImageAttachment = async (id, x, y) => {
|
|
1861
|
+
await invoke$1('Chat.handleContextMenuChatImageAttachment', id, x, y);
|
|
1862
|
+
};
|
|
1857
1863
|
const setAddContextButtonEnabled = async enabled => {
|
|
1858
1864
|
await invoke$1('Chat.setAddContextButtonEnabled', enabled);
|
|
1859
1865
|
};
|
|
@@ -1917,6 +1923,7 @@ const Chat = {
|
|
|
1917
1923
|
handleClickNew,
|
|
1918
1924
|
handleClickSessionDebug,
|
|
1919
1925
|
handleClickSettings,
|
|
1926
|
+
handleContextMenuChatImageAttachment,
|
|
1920
1927
|
handleDropFiles,
|
|
1921
1928
|
handleInput: handleInput$7,
|
|
1922
1929
|
handleInputCopy: handleInputCopy$1,
|
|
@@ -1939,6 +1946,7 @@ const Chat = {
|
|
|
1939
1946
|
openGitBranchPicker,
|
|
1940
1947
|
openMockSession,
|
|
1941
1948
|
openModelPicker,
|
|
1949
|
+
registerMockResponse,
|
|
1942
1950
|
rerender,
|
|
1943
1951
|
reset,
|
|
1944
1952
|
selectIndex: selectIndex$7,
|
|
@@ -4506,14 +4514,20 @@ const execute = async (href, platform, assetDir) => {
|
|
|
4506
4514
|
setUrl(scriptUrl); // TODO avoid side effect
|
|
4507
4515
|
// 2. import that script
|
|
4508
4516
|
const module = await importTest(scriptUrl);
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4517
|
+
const {
|
|
4518
|
+
mockRpc,
|
|
4519
|
+
name,
|
|
4520
|
+
skip,
|
|
4521
|
+
test
|
|
4522
|
+
} = module;
|
|
4523
|
+
if (mockRpc) {
|
|
4524
|
+
setMockRpc(mockRpc);
|
|
4525
|
+
}
|
|
4526
|
+
if (test) {
|
|
4527
|
+
if (skip) {
|
|
4528
|
+
await skipTest(name);
|
|
4515
4529
|
} else {
|
|
4516
|
-
await executeTest(
|
|
4530
|
+
await executeTest(name, test, globals);
|
|
4517
4531
|
}
|
|
4518
4532
|
}
|
|
4519
4533
|
// TODO maybe setup file watcher earlier, to not miss events?
|