1- import { ActionDescriptor , CommandV6 } from "@cursorless/common" ;
1+ import {
2+ ActionDescriptor ,
3+ CommandResponse ,
4+ CommandV6 ,
5+ } from "@cursorless/common" ;
26
37export interface SpokenFormTest {
48 /**
@@ -12,7 +16,7 @@ export interface SpokenFormTest {
1216 * `user.private_cursorless_run_rpc_command_get` action to return the given
1317 * value.
1418 */
15- mockedGetValue : unknown | undefined ;
19+ mockedGetValue : CommandResponse | undefined ;
1620
1721 /**
1822 * The sequence of Cursorless commands that should be executed when
@@ -28,7 +32,7 @@ export function spokenFormTest(
2832) : SpokenFormTest {
2933 return {
3034 spokenForm,
31- mockedGetValue,
35+ mockedGetValue : wrapMockedGetValue ( mockedGetValue ) ,
3236 commands : [ command ( spokenForm , action ) ] ,
3337 } ;
3438}
@@ -40,11 +44,17 @@ export function multiActionSpokenFormTest(
4044) : SpokenFormTest {
4145 return {
4246 spokenForm,
43- mockedGetValue,
47+ mockedGetValue : wrapMockedGetValue ( mockedGetValue ) ,
4448 commands : actions . map ( ( action ) => command ( spokenForm , action ) ) ,
4549 } ;
4650}
4751
52+ function wrapMockedGetValue (
53+ mockedGetValue : unknown ,
54+ ) : CommandResponse | undefined {
55+ return mockedGetValue == null ? undefined : { returnValue : mockedGetValue } ;
56+ }
57+
4858function command ( spokenForm : string , action : ActionDescriptor ) : CommandV6 {
4959 return {
5060 version : 6 ,
0 commit comments