MCPcopy Create free account
hub / github.com/cursorless-dev/cursorless / preCommandHook

Method preCommandHook

src/testUtil/TestCaseRecorder.ts:44–60  ·  view source on GitHub ↗
(command: TestCaseCommand, context: TestCaseContext)

Source from the content-addressed store, hash-verified

42 }
43
44 async preCommandHook(command: TestCaseCommand, context: TestCaseContext) {
45 if (this.testCase != null) {
46 // If testCase is not null and we are just before a command, this means
47 // that this command is the follow up command indicating which marks we
48 // cared about from the last command
49 invariant(
50 this.testCase.awaitingFinalMarkInfo,
51 () => "expected to be awaiting final mark info"
52 );
53 this.testCase.filterMarks(command, context);
54 await this.finishTestCase();
55 } else {
56 // Otherwise, we are starting a new test case
57 this.testCase = new TestCase(command, context, this.isHatTokenMapTest);
58 await this.testCase.recordInitialState();
59 }
60 }
61
62 async postCommandHook(returnValue: any) {
63 if (this.testCase == null) {

Callers 1

runCommandMethod · 0.80

Calls 3

finishTestCaseMethod · 0.95
filterMarksMethod · 0.80
recordInitialStateMethod · 0.80

Tested by

no test coverage detected