mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 00:28:52 +01:00
testing: improve test children API
This changeset results from the discussion in and fixes #126987. Migration for these changes should take about 15-20 minutes. - `createTestItem` no longer takes a parent. Instead, it creates a free- floating test item, which can be added as a child of a parent. - The `TestItem.children` is now a `TestItemCollection`, a set-like interface that also allows replacing items (intelligently diffing them internally) wholesale. This removes the need for the "generation counter" used in samples previously. - There is no longer a `root` on the test controller, but instead an `items` property which is the same `TestItemCollection` - The `tests` in the `TestRunRequest` has been replaced with an `include` property. If undefined, the extension should run all tests. (Since there is no longer a root to reference). Here's some example migrations: -3fad3d66c1-3aff746316
This commit is contained in:
@@ -346,6 +346,10 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
|
||||
checkProposedApiEnabled(extension);
|
||||
return extHostTesting.createTestController(provider, label);
|
||||
},
|
||||
createTestItem(id, label, uri) {
|
||||
checkProposedApiEnabled(extension);
|
||||
return extHostTesting.createTestItem(id, label, uri);
|
||||
},
|
||||
createTestObserver() {
|
||||
checkProposedApiEnabled(extension);
|
||||
return extHostTesting.createTestObserver();
|
||||
|
||||
Reference in New Issue
Block a user