Skip to content

Commit b754391

Browse files
committed
add retire event
1 parent 6c72ac8 commit b754391

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

src/index.ts

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,21 @@ export interface TestAdapter {
9191
readonly testStates: vscode.Event<TestRunStartedEvent | TestRunFinishedEvent | TestSuiteEvent | TestEvent>;
9292

9393
/**
94-
* This event can be used by the adapter to trigger a test run for all tests that have
95-
* been set to "autorun" in the Test Explorer.
96-
* Note that the Test Explorer will automatically trigger such a test run when it receives a
97-
* `TestLoadFinishedEvent`. In other words, you should *not* send this event after reloading
98-
* the tests as this would result in 2 identical test runs being triggered.
94+
* This event can be used by the adapter to inform the Test Explorer about tests whose states
95+
* are outdated.
96+
* This is usually sent directly after a `TestLoadFinishedEvent` to specify which tests may
97+
* have changed. Furthermore, it should be sent when the source files for the application
98+
* under test have changed.
99+
* This will also trigger a test run for those tests that have been set to "autorun" by the
100+
* user and which are retired by this event.
101+
* If the adapter does not implement this event then the Test Explorer will automatically
102+
* retire (and possibly autorun) all tests after each `TestLoadFinishedEvent`.
103+
*/
104+
readonly retire?: vscode.Event<RetireEvent>;
105+
106+
/**
107+
* @deprecated This event is deprecated, use the `retire` event instead.
108+
* For backwards compatibility, `autorun.fire()` calls have the same effect as `retire.fire({})`.
99109
*/
100110
readonly autorun?: vscode.Event<void>;
101111
}
@@ -307,3 +317,12 @@ export interface TestDecoration {
307317
*/
308318
hover?: string;
309319
}
320+
321+
export interface RetireEvent {
322+
323+
/**
324+
* An array of test or suite IDs. For every suite ID, all tests in that suite will be retired.
325+
* If this isn't defined then all tests will be retired.
326+
*/
327+
tests?: string[];
328+
}

0 commit comments

Comments
 (0)